summaryrefslogtreecommitdiff
path: root/gen_x86.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-04-25 21:01:11 -0700
committerMike Pavone <pavone@retrodev.com>2013-04-25 21:01:11 -0700
commit46db74a053d7fca9dee69e8737a435e65b538577 (patch)
treefa645a9997fac9f040b6664ffbaf9b0733fdc71e /gen_x86.c
parent68be5ac1a6452de7333d77b91d5a9634aac05b5b (diff)
Get Z80 core working for simple programs
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;