summaryrefslogtreecommitdiff
path: root/gen_x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'gen_x86.c')
-rw-r--r--gen_x86.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gen_x86.c b/gen_x86.c
index 2deb864..97573b8 100644
--- a/gen_x86.c
+++ b/gen_x86.c
@@ -1490,6 +1490,10 @@ uint8_t * jmp(uint8_t * out, uint8_t * dest)
uint8_t * jmp_r(uint8_t * out, uint8_t dst)
{
+ if (dst >= R8) {
+ dst -= R8 - X86_R8;
+ *(out++) = PRE_REX | REX_RM_FIELD;
+ }
*(out++) = OP_SINGLE_EA;
*(out++) = MODE_REG_DIRECT | dst | (OP_EX_JMP_EA << 3);
return out;