diff options
author | Mike Pavone <pavone@retrodev.com> | 2012-12-29 22:11:28 -0800 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2012-12-29 22:11:28 -0800 |
commit | 02f56f5ca59506d7d81a302511f59cb8d122e764 (patch) | |
tree | 69a740de5eee188aa12f75db05ed68cdf8635bc8 /gen_x86.c | |
parent | 8e2538755910dee022b72ccaeac487d1ae8900c7 (diff) |
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
Diffstat (limited to 'gen_x86.c')
-rw-r--r-- | gen_x86.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -962,11 +962,11 @@ uint8_t * movsx_rr(uint8_t * out, uint8_t src, uint8_t dst, uint8_t src_size, ui *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 @@ uint8_t * movsx_rdisp8r(uint8_t * out, uint8_t src, int8_t disp, uint8_t dst, ui *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++; |