Mercurial > repos > blastem
comparison 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 |
comparison
equal
deleted
inserted
replaced
389:3815ad1e684e | 390:561fe3ea3fc8 |
---|---|
245 /* genesis Z80 has no IO port hardware and writes have no effect */ | 245 /* genesis Z80 has no IO port hardware and writes have no effect */ |
246 ret | 246 ret |
247 | 247 |
248 .global z80_retrans_stub | 248 .global z80_retrans_stub |
249 z80_retrans_stub: | 249 z80_retrans_stub: |
250 call z80_save_context | 250 pop %r14 |
251 call z80_save_context | |
252 /* adjust for mov and call instructions */ | |
253 sub $10, %r14 | |
251 mov %r13d, %edi | 254 mov %r13d, %edi |
255 mov %r14, %rdx | |
252 push %rsi | 256 push %rsi |
253 call z80_retranslate_inst | 257 call z80_retranslate_inst |
254 pop %rsi | 258 pop %rsi |
255 mov %rax, %r13 | 259 mov %rax, %r13 |
256 call z80_load_context | 260 call z80_load_context |