# HG changeset patch # User Mike Pavone # Date 1356721633 28800 # Node ID 1eba2b9455f8df9f4a903146ad1a07ce9b4fbd51 # Parent 1a0fd122ca8f700ea36fb1f2444fd53c87a3d1bd Implement ORI to CCR/SR diff -r 1a0fd122ca8f -r 1eba2b9455f8 m68k_to_x86.c --- a/m68k_to_x86.c Fri Dec 28 10:37:09 2012 -0800 +++ b/m68k_to_x86.c Fri Dec 28 11:07:13 2012 -0800 @@ -2037,9 +2037,30 @@ 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: