diff gen_x86.c @ 125:dc5fc3adf705

Fix encoding of movsx instruction when used with new (i.e. r9-r15) registers. This fixes the indexed addressing modes when used with a word-wide index register
author Mike Pavone <pavone@retrodev.com>
date Sat, 29 Dec 2012 22:11:28 -0800
parents bd3858121ab0
children 5416a5c4628e
line wrap: on
line diff
--- a/gen_x86.c	Sat Dec 29 21:55:42 2012 -0800
+++ b/gen_x86.c	Sat Dec 29 22:11:28 2012 -0800
@@ -962,11 +962,11 @@
 			*out |= REX_QUAD;
 		}
 		if (src >= R8) {
-			*out |= REX_REG_FIELD;
+			*out |= REX_RM_FIELD;
 			src -= (R8 - X86_R8);
 		}
 		if (dst >= R8) {
-			*out |= REX_RM_FIELD;
+			*out |= REX_REG_FIELD;
 			dst -= (R8 - X86_R8);
 		}
 		out++;
@@ -992,11 +992,11 @@
 			*out |= REX_QUAD;
 		}
 		if (src >= R8) {
-			*out |= REX_REG_FIELD;
+			*out |= REX_RM_FIELD;
 			src -= (R8 - X86_R8);
 		}
 		if (dst >= R8) {
-			*out |= REX_RM_FIELD;
+			*out |= REX_REG_FIELD;
 			dst -= (R8 - X86_R8);
 		}
 		out++;