summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gen_x86.c10
-rw-r--r--m68k_to_x86.c2
2 files changed, 5 insertions, 7 deletions
diff --git a/gen_x86.c b/gen_x86.c
index c062ac8..2ec4c00 100644
--- a/gen_x86.c
+++ b/gen_x86.c
@@ -359,13 +359,11 @@ uint8_t * x86_rrindex_sizedir(uint8_t * out, uint8_t opcode, uint8_t reg, uint8_
opcode |= BIT_SIZE;
}
*(out++) = opcode | dir;
- *(out++) = MODE_REG_INDIRECT | base | (RSP << 3);
- if (base == RSP) {
- if (scale == 4) {
- scale = 3;
- }
- *(out++) = scale << 6 | (index << 3) | base;
+ *(out++) = MODE_REG_INDIRECT | RSP | (reg << 3);
+ if (scale == 4) {
+ scale = 3;
}
+ *(out++) = scale << 6 | (index << 3) | base;
return out;
}
diff --git a/m68k_to_x86.c b/m68k_to_x86.c
index 959d62b..886cc08 100644
--- a/m68k_to_x86.c
+++ b/m68k_to_x86.c
@@ -4499,7 +4499,7 @@ code_ptr gen_mem_fun(cpu_options * opts, memmap_chunk * memmap, uint32_t num_chu
dst = mov_rrind(dst, SCRATCH1, SCRATCH2, tmp_size);
} else {
dst = mov_ir(dst, (intptr_t)memmap[chunk].buffer, SCRATCH2, SZ_PTR);
- dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 1, SCRATCH1, tmp_size);
+ dst = mov_rindexr(dst, SCRATCH2, SCRATCH1, 0, SCRATCH1, tmp_size);
}
}
if (size != tmp_size && !is_write) {