From 153645cdd7fde5e34b8c2e66512abd815c2418a7 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 18 Sep 2015 19:54:02 -0700 Subject: Fixed a copy pasta error in the implementation of LDD and LDDR. HL should be decremented and not incremented in those instructions. --- 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 4dfed6a..5429da4 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -632,7 +632,7 @@ void translate_z80inst(z80inst * inst, z80_context * context, uint16_t address, sub_irdisp(code, 1, opts->gen.context_reg, zr_off(Z80_DE), SZ_W); } if (opts->regs[Z80_HL] >= 0) { - add_ir(code, 1, opts->regs[Z80_HL], SZ_W); + sub_ir(code, 1, opts->regs[Z80_HL], SZ_W); } else { sub_irdisp(code, 1, opts->gen.context_reg, zr_off(Z80_HL), SZ_W); } @@ -658,7 +658,7 @@ void translate_z80inst(z80inst * inst, z80_context * context, uint16_t address, sub_irdisp(code, 1, opts->gen.context_reg, zr_off(Z80_DE), SZ_W); } if (opts->regs[Z80_HL] >= 0) { - add_ir(code, 1, opts->regs[Z80_HL], SZ_W); + sub_ir(code, 1, opts->regs[Z80_HL], SZ_W); } else { sub_irdisp(code, 1, opts->gen.context_reg, zr_off(Z80_HL), SZ_W); } -- cgit v1.2.3