From 500159f495096fe4124f1d65cf258fb60c2673a5 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 31 Oct 2015 01:07:56 -0700 Subject: Set flags for ld a, r --- z80_to_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'z80_to_x86.c') diff --git a/z80_to_x86.c b/z80_to_x86.c index 071c524..215a7cb 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -404,8 +404,8 @@ void translate_z80inst(z80inst * inst, z80_context * context, uint16_t address, mov_rdispr(code, src_op.base, src_op.disp, dst_op.base, size); } } - if (inst->ea_reg == Z80_I && inst->addr_mode == Z80_REG) { - //ld a, i sets some flags + if ((inst->ea_reg == Z80_I || inst->ea_reg == Z80_R) && inst->addr_mode == Z80_REG) { + //ld a, i and ld a, r sets some flags cmp_ir(code, 0, dst_op.base, SZ_B); setcc_rdisp(code, CC_Z, opts->gen.context_reg, zf_off(ZF_Z)); setcc_rdisp(code, CC_S, opts->gen.context_reg, zf_off(ZF_S)); -- cgit v1.2.3