changeset 1057:ff46d8fc2de8

Fix handling of undocumented flag bits for ADD in 32-bit builds
author Michael Pavone <pavone@retrodev.com>
date Sat, 30 Jul 2016 16:01:57 -0700
parents 47c748455365
children 266dc3f31f35
files z80_to_x86.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/z80_to_x86.c	Sat Jul 30 14:03:25 2016 -0700
+++ b/z80_to_x86.c	Sat Jul 30 16:01:57 2016 -0700
@@ -909,7 +909,7 @@
 				mov_rdispr(code, src_op.base, src_op.disp, opts->gen.scratch1, z80_size(inst));
 				add_rrdisp(code, opts->gen.scratch1, dst_op.base, dst_op.disp, z80_size(inst));
 			}
-			mov_rdispr(code, dst_op.base, dst_op.disp + z80_size(inst) == SZ_B ? 0 : 8, opts->gen.scratch1, SZ_B);
+			mov_rdispr(code, dst_op.base, dst_op.disp + (z80_size(inst) == SZ_B ? 0 : 1), opts->gen.scratch1, SZ_B);
 			mov_rrdisp(code, opts->gen.scratch1, opts->gen.context_reg, zf_off(ZF_XY), SZ_B);
 		}
 		setcc_rdisp(code, CC_C, opts->gen.context_reg, zf_off(ZF_C));