diff zruntime.S @ 390:561fe3ea3fc8

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
author Mike Pavone <pavone@retrodev.com>
date Sat, 08 Jun 2013 11:31:52 -0700
parents 134ffb72d7a1
children 30c250a41629
line wrap: on
line diff
--- a/zruntime.S	Thu Jun 06 08:45:54 2013 -0700
+++ b/zruntime.S	Sat Jun 08 11:31:52 2013 -0700
@@ -247,8 +247,12 @@
 	
 	.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