# HG changeset patch # User Mike Pavone # Date 1366443410 25200 # Node ID 1abf8e967b33dc269988c1a30316d2216c9a95a0 # Parent acd29e2664c685bd303aec8657b6d0c5296ac072 Fix autoincrement on a7 when used as a destination in a byte sized instruction diff -r acd29e2664c6 -r 1abf8e967b33 m68k_to_x86.c --- a/m68k_to_x86.c Sat Apr 20 00:29:14 2013 -0700 +++ b/m68k_to_x86.c Sat Apr 20 00:36:50 2013 -0700 @@ -438,7 +438,7 @@ } 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 @@ 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 {