diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-09-18 19:54:02 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-09-18 19:54:02 -0700 |
commit | 153645cdd7fde5e34b8c2e66512abd815c2418a7 (patch) | |
tree | faa9b2fbda7349c5fff02160ba2e455fbdb528de /z80_to_x86.c | |
parent | a541ae7d90497cf9ed02845e44266fbe8f3db5ad (diff) |
Fixed a copy pasta error in the implementation of LDD and LDDR. HL should be decremented and not incremented in those instructions.
Diffstat (limited to 'z80_to_x86.c')
-rw-r--r-- | z80_to_x86.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |