# HG changeset patch # User Michael Pavone # Date 1487554645 28800 # Node ID 197cb199a35b160c6fd5c38c4c8cbfe1d9ada58b # Parent 15c5be05e6a9b441dc71dafb2cf838d8ab8a429e Fix loading of the R register from the in memory context diff -r 15c5be05e6a9 -r 197cb199a35b z80_to_x86.c --- a/z80_to_x86.c Sun Feb 19 12:41:57 2017 -0800 +++ b/z80_to_x86.c Sun Feb 19 17:37:25 2017 -0800 @@ -3277,9 +3277,6 @@ or_rrdisp(code, options->regs[Z80_R], options->gen.context_reg, zr_off(Z80_R), SZ_B); } else if (options->regs[reg] >= 0) { mov_rrdisp(code, options->regs[reg], options->gen.context_reg, zr_off(reg), size); - if (reg == Z80_R) { - and_irdisp(code, 0x80, options->gen.context_reg, zr_off(reg), SZ_B); - } } if (size == SZ_W) { i++; @@ -3310,6 +3307,9 @@ } if (options->regs[reg] >= 0) { mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, regs) + i, options->regs[reg], size); + if (reg == Z80_R) { + and_irdisp(code, 0x80, options->gen.context_reg, zr_off(reg), SZ_B); + } } if (size == SZ_W) { i++;