summaryrefslogtreecommitdiff
path: root/z80_to_x86.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-03-02 22:18:15 -0800
committerMichael Pavone <pavone@retrodev.com>2017-03-02 22:18:15 -0800
commite9b8afabb9c182a6058452e622cabc3602c0cf26 (patch)
tree7995285658943120ffc4d89a76e1dc3ede806ab2 /z80_to_x86.c
parent9cee9ef2dbd75efac5f3ae4a21c348d8922d56e2 (diff)
Fix implementation of in c and out c on 32-bit x86
Diffstat (limited to 'z80_to_x86.c')
-rw-r--r--z80_to_x86.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c
index 5303bf2..00788a0 100644
--- a/z80_to_x86.c
+++ b/z80_to_x86.c
@@ -2322,7 +2322,7 @@ void translate_z80inst(z80inst * inst, z80_context * context, uint16_t address,
if (inst->addr_mode == Z80_IMMED_INDIRECT) {
mov_ir(code, inst->immed, opts->gen.scratch1, SZ_B);
} else {
- mov_rr(code, opts->regs[Z80_C], opts->gen.scratch1, SZ_B);
+ zreg_to_native(opts, Z80_C, opts->gen.scratch2);
}
call(code, opts->read_io);
if (inst->addr_mode != Z80_IMMED_INDIRECT) {
@@ -2602,7 +2602,6 @@ void translate_z80inst(z80inst * inst, z80_context * context, uint16_t address,
mov_ir(code, inst->immed, opts->gen.scratch2, SZ_B);
} else {
zreg_to_native(opts, Z80_C, opts->gen.scratch2);
- mov_rr(code, opts->regs[Z80_C], opts->gen.scratch2, SZ_B);
}
translate_z80_reg(inst, &src_op, opts);
if (src_op.mode == MODE_REG_DIRECT) {