changeset 182:924af8b2f7a0

Fix -(a7) dest when size is byte
author Mike Pavone <pavone@retrodev.com>
date Wed, 09 Jan 2013 21:41:55 -0800
parents 3b4ef459aa8d
children 2f08d9e90a4c
files m68k_to_x86.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/m68k_to_x86.c	Wed Jan 09 21:08:37 2013 -0800
+++ b/m68k_to_x86.c	Wed Jan 09 21:41:55 2013 -0800
@@ -392,7 +392,7 @@
 		ea->disp = reg_offset(&(inst->dst));
 		break;
 	case MODE_AREG_PREDEC:
-		dec_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : 1);
+		dec_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 = sub_ir(out, dec_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D);
 		} else {
@@ -780,7 +780,7 @@
 		dst = setcc_r(dst, CC_S, FLAG_N);
 		break;
 	case MODE_AREG_PREDEC:
-		dec_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : 1);
+		dec_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 = sub_ir(dst, dec_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D);
 		} else {