summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-12-12 19:21:22 -0800
committerMichael Pavone <pavone@retrodev.com>2016-12-12 19:21:22 -0800
commit54e71ce54fe55606ab62d7db53ab8f63f2514ca3 (patch)
treea478ebf51cb558b17a0f421b3f938cc56191df04
parent4ee89f324a86790871f3ea0f1e15f96f8460864b (diff)
Fix to the fix of handling of self modifying code. Was ORing the base address with the wrong register before calling the modified code handler
-rw-r--r--backend_x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend_x86.c b/backend_x86.c
index a93a273..fcf01cd 100644
--- a/backend_x86.c
+++ b/backend_x86.c
@@ -231,7 +231,7 @@ code_ptr gen_mem_fun(cpu_options * opts, memmap_chunk const * memmap, uint32_t n
code_ptr not_code = code->cur + 1;
jcc(code, CC_NC, code->cur + 2);
if (memmap[chunk].mask != opts->address_mask) {
- or_ir(code, memmap[chunk].start, opts->scratch1, opts->address_size);
+ or_ir(code, memmap[chunk].start, opts->scratch2, opts->address_size);
}
call(code, opts->save_context);
call_args(code, opts->handle_code_write, 2, opts->scratch2, opts->context_reg);