From 1d7cd4524ed0704b43d79d8827dceef5f1987701 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Sat, 20 Apr 2013 00:36:50 -0700 Subject: Fix autoincrement on a7 when used as a destination in a byte sized instruction --- m68k_to_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm68k_to_x86.c') diff --git a/m68k_to_x86.c b/m68k_to_x86.c index ffa98e5..e149526 100644 --- a/m68k_to_x86.c +++ b/m68k_to_x86.c @@ -438,7 +438,7 @@ uint8_t * translate_m68k_dst(m68kinst * inst, x86_ea * ea, uint8_t * out, x86_68 } if (inst->dst.addr_mode == MODE_AREG_POSTINC) { - inc_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : 1); + inc_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : (inst->dst.params.regs.pri == 7 ? 2 : 1)); if (opts->aregs[inst->dst.params.regs.pri] >= 0) { out = add_ir(out, inc_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D); } else { @@ -891,7 +891,7 @@ uint8_t * translate_m68k_move(uint8_t * dst, m68kinst * inst, x86_68k_options * break; } if (inst->dst.addr_mode == MODE_AREG_POSTINC) { - inc_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : 1); + inc_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : (inst->dst.params.regs.pri == 7 ? 2 : 1)); if (opts->aregs[inst->dst.params.regs.pri] >= 0) { dst = add_ir(dst, inc_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D); } else { -- cgit v1.2.3