summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2012-12-28 17:59:41 -0800
committerMike Pavone <pavone@retrodev.com>2012-12-28 17:59:41 -0800
commite9348e64584c3fdc88bc6de533216f09b679126d (patch)
tree7263221bccded304d89398f6f2c8d3bf71eb6bed
parentc7827141fecf66bc83c5cbb1cd0a38fd925e2689 (diff)
Defer the correct address for pc relative jsr/jmp
-rw-r--r--m68k_to_x86.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/m68k_to_x86.c b/m68k_to_x86.c
index 06d0e63..f83165c 100644
--- a/m68k_to_x86.c
+++ b/m68k_to_x86.c
@@ -1449,7 +1449,7 @@ uint8_t * translate_m68k_jmp(uint8_t * dst, m68kinst * inst, x86_68k_options * o
dst = cycles(dst, 10);
dest_addr = get_native_address(opts->native_code_map, inst->src.params.regs.displacement + inst->address + 2);
if (!dest_addr) {
- opts->deferred = defer_address(opts->deferred, inst->src.params.immed, dst + 1);
+ opts->deferred = defer_address(opts->deferred, inst->src.params.regs.displacement + inst->address + 2, dst + 1);
//dummy address to be replaced later, make sure it generates a 4-byte displacement
dest_addr = dst + 256;
}
@@ -1557,7 +1557,7 @@ uint8_t * translate_m68k_jsr(uint8_t * dst, m68kinst * inst, x86_68k_options * o
dst = call(dst, (char *)m68k_write_long_highfirst);
dest_addr = get_native_address(opts->native_code_map, inst->src.params.regs.displacement + inst->address + 2);
if (!dest_addr) {
- opts->deferred = defer_address(opts->deferred, inst->src.params.immed, dst + 1);
+ opts->deferred = defer_address(opts->deferred, inst->src.params.regs.displacement + inst->address + 2, dst + 1);
//dummy address to be replaced later, make sure it generates a 4-byte displacement
dest_addr = dst + 5;
}