# HG changeset patch # User Michael Pavone # Date 1488521895 28800 # Node ID cad1642baf66b6c29d65a8f87a1c6b1b6327de98 # Parent 23c94f5266d1abf22fab813a392cda3afc141ca9 Fix implementation of in c and out c on 32-bit x86 diff -r 23c94f5266d1 -r cad1642baf66 z80_to_x86.c --- a/z80_to_x86.c Thu Mar 02 21:08:33 2017 -0800 +++ b/z80_to_x86.c Thu Mar 02 22:18:15 2017 -0800 @@ -2322,7 +2322,7 @@ 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 @@ 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) {