# HG changeset patch # User Michael Pavone # Date 1442631242 25200 # Node ID 22c3c52b9871c31b7648d9198813518f2bd46857 # Parent 35f5658d141f2e3d04ec83bef3ba633491935cbc Fixed a copy pasta error in the implementation of LDD and LDDR. HL should be decremented and not incremented in those instructions. diff -r 35f5658d141f -r 22c3c52b9871 z80_to_x86.c --- a/z80_to_x86.c Wed Aug 05 23:23:15 2015 -0700 +++ b/z80_to_x86.c Fri Sep 18 19:54:02 2015 -0700 @@ -632,7 +632,7 @@ 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 @@ 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); }