Mercurial > repos > blastem
diff gen_x86.c @ 1465:5d41d0574863
Preserve original address when retranslating instructions instead of switching to the lowest alias
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 13 Sep 2017 21:06:25 -0700 |
parents | 101b5ce682fe |
children | 723f6381cffa |
line wrap: on
line diff
--- a/gen_x86.c Fri Sep 08 00:38:22 2017 -0700 +++ b/gen_x86.c Wed Sep 13 21:06:25 2017 -0700 @@ -1307,6 +1307,15 @@ code->cur = out; } +uint8_t is_mov_ir(code_ptr inst) +{ + while (*inst == PRE_SIZE || *inst == PRE_REX) + { + inst++; + } + return (*inst & 0xF8) == OP_MOV_I8R || (*inst & 0xF8) == OP_MOV_IR || (*inst & 0xFE) == OP_MOV_IEA; +} + void mov_irdisp(code_info *code, int32_t val, uint8_t dst, int32_t disp, uint8_t size) { check_alloc_code(code, 12);