comparison z80_to_x86.c @ 1260:cad1642baf66

Fix implementation of in c and out c on 32-bit x86
author Michael Pavone <pavone@retrodev.com>
date Thu, 02 Mar 2017 22:18:15 -0800
parents 197cb199a35b
children 70d88d9bfe13
comparison
equal deleted inserted replaced
1259:23c94f5266d1 1260:cad1642baf66
2320 } 2320 }
2321 cycles(&opts->gen, num_cycles);//T States: 4 3/4 2321 cycles(&opts->gen, num_cycles);//T States: 4 3/4
2322 if (inst->addr_mode == Z80_IMMED_INDIRECT) { 2322 if (inst->addr_mode == Z80_IMMED_INDIRECT) {
2323 mov_ir(code, inst->immed, opts->gen.scratch1, SZ_B); 2323 mov_ir(code, inst->immed, opts->gen.scratch1, SZ_B);
2324 } else { 2324 } else {
2325 mov_rr(code, opts->regs[Z80_C], opts->gen.scratch1, SZ_B); 2325 zreg_to_native(opts, Z80_C, opts->gen.scratch2);
2326 } 2326 }
2327 call(code, opts->read_io); 2327 call(code, opts->read_io);
2328 if (inst->addr_mode != Z80_IMMED_INDIRECT) { 2328 if (inst->addr_mode != Z80_IMMED_INDIRECT) {
2329 or_rr(code, opts->gen.scratch1, opts->gen.scratch1, SZ_B); 2329 or_rr(code, opts->gen.scratch1, opts->gen.scratch1, SZ_B);
2330 mov_irdisp(code, 0, opts->gen.context_reg, zf_off(ZF_H), SZ_B); 2330 mov_irdisp(code, 0, opts->gen.context_reg, zf_off(ZF_H), SZ_B);
2600 cycles(&opts->gen, num_cycles);//T States: 4 3/4 2600 cycles(&opts->gen, num_cycles);//T States: 4 3/4
2601 if ((inst->addr_mode & 0x1F) == Z80_IMMED_INDIRECT) { 2601 if ((inst->addr_mode & 0x1F) == Z80_IMMED_INDIRECT) {
2602 mov_ir(code, inst->immed, opts->gen.scratch2, SZ_B); 2602 mov_ir(code, inst->immed, opts->gen.scratch2, SZ_B);
2603 } else { 2603 } else {
2604 zreg_to_native(opts, Z80_C, opts->gen.scratch2); 2604 zreg_to_native(opts, Z80_C, opts->gen.scratch2);
2605 mov_rr(code, opts->regs[Z80_C], opts->gen.scratch2, SZ_B);
2606 } 2605 }
2607 translate_z80_reg(inst, &src_op, opts); 2606 translate_z80_reg(inst, &src_op, opts);
2608 if (src_op.mode == MODE_REG_DIRECT) { 2607 if (src_op.mode == MODE_REG_DIRECT) {
2609 mov_rr(code, src_op.base, opts->gen.scratch1, SZ_B); 2608 mov_rr(code, src_op.base, opts->gen.scratch1, SZ_B);
2610 } else if (src_op.mode == MODE_IMMED) { 2609 } else if (src_op.mode == MODE_IMMED) {