summaryrefslogtreecommitdiff
path: root/gen_x86.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-09-13 21:06:25 -0700
committerMichael Pavone <pavone@retrodev.com>2017-09-13 21:06:25 -0700
commit44ccdde6fced7672b184be82b4eaf994c1c705c5 (patch)
tree7ee628871001a1704a9174ab600803d699dd0058 /gen_x86.c
parent5ce0a0e79020bd6e9e42bc32f706b208066d7ec0 (diff)
Preserve original address when retranslating instructions instead of switching to the lowest alias
Diffstat (limited to 'gen_x86.c')
-rw-r--r--gen_x86.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gen_x86.c b/gen_x86.c
index 2840ba0..d8dd157 100644
--- a/gen_x86.c
+++ b/gen_x86.c
@@ -1307,6 +1307,15 @@ void mov_ir(code_info *code, int64_t val, uint8_t dst, uint8_t size)
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);