From 77b305b44b0857a3e4bb6fd22ee96e4bb42323cc Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 26 Dec 2014 19:38:27 -0800 Subject: Fix a bug in ori to SR that was swapping USP and SSP inappropriately --- m68k_core_x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m68k_core_x86.c b/m68k_core_x86.c index 96e1cfa..ef84721 100644 --- a/m68k_core_x86.c +++ b/m68k_core_x86.c @@ -1896,7 +1896,7 @@ void translate_m68k_andi_ori_ccr_sr(m68k_options *opts, m68kinst *inst) } else { or_irdisp(code, inst->src.params.immed >> 8, opts->gen.context_reg, offsetof(m68k_context, status), SZ_B); } - if ((base_flag == X0) ^ (((inst->src.params.immed >> 8) & (1 << BIT_SUPERVISOR)) > 0)) { + if (inst->op == M68K_ANDI_SR && !(inst->src.params.immed & (1 << (BIT_SUPERVISOR + 8)))) { //leave supervisor mode swap_ssp_usp(opts); } -- cgit v1.2.3