From 5ce0a0e79020bd6e9e42bc32f706b208066d7ec0 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 8 Sep 2017 00:38:22 -0700 Subject: Fix unlk for the a7 case --- m68k_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'm68k_core.c') diff --git a/m68k_core.c b/m68k_core.c index 6218e75..1f23c07 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -284,11 +284,15 @@ static void translate_m68k_jmp_jsr(m68k_options * opts, m68kinst * inst) static void translate_m68k_unlk(m68k_options * opts, m68kinst * inst) { cycles(&opts->gen, BUS); - areg_to_native(opts, inst->dst.params.regs.pri, opts->aregs[7]); + if (inst->dst.params.regs.pri != 7) { + areg_to_native(opts, inst->dst.params.regs.pri, opts->aregs[7]); + } areg_to_native(opts, 7, opts->gen.scratch1); call(&opts->gen.code, opts->read_32); native_to_areg(opts, opts->gen.scratch1, inst->dst.params.regs.pri); - addi_areg(opts, 4, 7); + if (inst->dst.params.regs.pri != 7) { + addi_areg(opts, 4, 7); + } } static void translate_m68k_link(m68k_options * opts, m68kinst * inst) -- cgit v1.2.3