summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-10-31 01:07:56 -0700
committerMichael Pavone <pavone@retrodev.com>2015-10-31 01:07:56 -0700
commit500159f495096fe4124f1d65cf258fb60c2673a5 (patch)
tree10c6aaad3744b18b03569eb1b82afaa560182462
parent94c98373a570f70a7d9e33bb9bd38cba48c9e6d5 (diff)
Set flags for ld a, r
-rw-r--r--z80_to_x86.c4
1 files changed, 2 insertions, 2 deletions
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));