summaryrefslogtreecommitdiff
path: root/zruntime.S
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-06-08 11:31:52 -0700
committerMike Pavone <pavone@retrodev.com>2013-06-08 11:31:52 -0700
commitc451b9b3878da0c81feabb9501a9af55644ac12e (patch)
tree2edafb1ac40dc03f084031b06ffd2e6c5eed21cc /zruntime.S
parent871cb9435b2e33f45fd63b76472a7db2ca7bad8d (diff)
Use a call instruction to figure out the original native address when retranslating so that it does not get lost when the byte transforms from a instruction word to extension word
Diffstat (limited to 'zruntime.S')
-rw-r--r--zruntime.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/zruntime.S b/zruntime.S
index d6250fb..6dc353d 100644
--- a/zruntime.S
+++ b/zruntime.S
@@ -247,8 +247,12 @@ z80_io_write:
.global z80_retrans_stub
z80_retrans_stub:
+ pop %r14
call z80_save_context
+ /* adjust for mov and call instructions */
+ sub $10, %r14
mov %r13d, %edi
+ mov %r14, %rdx
push %rsi
call z80_retranslate_inst
pop %rsi