diff options
author | Mike Pavone <pavone@retrodev.com> | 2012-12-28 11:07:13 -0800 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2012-12-28 11:07:13 -0800 |
commit | 0ca6761b68d895b53c13d296d51e491ae2e57583 (patch) | |
tree | 4f2c5bd1b4c7dd80bb594ad3444362a7c6829b5f | |
parent | 761bca4b9e4a3826e81123f113b217fcea34a517 (diff) |
Implement ORI to CCR/SR
-rw-r--r-- | m68k_to_x86.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/m68k_to_x86.c b/m68k_to_x86.c index aabf407..13c7ea7 100644 --- a/m68k_to_x86.c +++ b/m68k_to_x86.c @@ -2037,9 +2037,30 @@ uint8_t * translate_m68k(uint8_t * dst, m68kinst * inst, x86_68k_options * opts) dst = mov_ir(dst, 0, FLAG_V, SZ_B); dst = m68k_save_result(inst, dst, opts); break; - /*case M68K_ORI_CCR: + case M68K_ORI_CCR: case M68K_ORI_SR: - case M68K_PEA: + dst = cycles(dst, 20); + //TODO: If ANDI to SR, trap if not in supervisor mode + if (inst->src.params.immed & 0x1) { + dst = mov_ir(dst, 1, FLAG_C, SZ_B); + } + if (inst->src.params.immed & 0x2) { + dst = mov_ir(dst, 1, FLAG_V, SZ_B); + } + if (inst->src.params.immed & 0x4) { + dst = mov_ir(dst, 1, FLAG_Z, SZ_B); + } + if (inst->src.params.immed & 0x8) { + dst = mov_ir(dst, 1, FLAG_N, SZ_B); + } + if (inst->src.params.immed & 0x10) { + dst = mov_irind(dst, 1, CONTEXT, SZ_B); + } + if (inst->op == M68K_ANDI_SR) { + dst = or_irdisp8(dst, inst->src.params.immed >> 8, CONTEXT, offsetof(m68k_context, status), SZ_B); + } + break; + /*case M68K_PEA: case M68K_RESET: case M68K_ROL: case M68K_ROR: |