changeset 1430:747c779fc137

Avoid generating an instruction that would require a REX prefix when a7 is used as a byte-wide source operand in 32-bit builds. Fixes a fatal error in Dragon's Fury when entering the option menu in a 32-bit build
author Michael Pavone <pavone@retrodev.com>
date Fri, 11 Aug 2017 18:43:48 -0700
parents 7e67f8a37051
children 030b40139de9
files m68k_core_x86.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/m68k_core_x86.c	Wed Aug 09 23:33:16 2017 -0700
+++ b/m68k_core_x86.c	Fri Aug 11 18:43:48 2017 -0700
@@ -381,6 +381,11 @@
 		if (!dst && inst->dst.addr_mode == MODE_AREG && inst->extra.size == OPSIZE_WORD) {
 			movsx_rr(code, reg, opts->gen.scratch1, SZ_W, SZ_D);
 			ea->base = opts->gen.scratch1;
+#ifdef X86_32
+		} else if (reg > RBX && inst->extra.size == OPSIZE_BYTE) {
+			mov_rr(code, reg, opts->gen.scratch1, SZ_D);
+			ea->base = opts->gen.scratch1;
+#endif
 		} else {
 			ea->base = reg;
 		}