summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-04-20 00:36:50 -0700
committerMike Pavone <pavone@retrodev.com>2013-04-20 00:36:50 -0700
commit1d7cd4524ed0704b43d79d8827dceef5f1987701 (patch)
tree1eef34f244bfe25276288d2d9d78875b04867975
parentde47bcbe905a80cf433076bc1dc7e3512cbe838b (diff)
Fix autoincrement on a7 when used as a destination in a byte sized instruction
-rw-r--r--m68k_to_x86.c4
1 files changed, 2 insertions, 2 deletions
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 {