Fix x64 Mov Reg, Imm32 (sign extended)

This commit is contained in:
Clement Rouault
2016-07-20 13:16:39 +02:00
parent 48a40fa520
commit 53acf21a2f
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -908,7 +908,7 @@ class Lea(Instruction):
class Mov(Instruction):
default_32_bits = True
encoding = [(Mov_RAX_OFF64(),), (Mov_OFF64_RAX(),),
(RawBits.from_int(8, 0xc7), Slash(0), AnyImm32()),
(RawBits.from_int(8, 0xc7), Slash(0), Imm32()),
(RawBits.from_int(8, 0x89), ModRM([ModRM_REG__REG, ModRM_REG64__MEM])),
(RawBits.from_int(5, 0xb8 >> 3), X64RegisterSelector(), Imm64())]
+4
View File
@@ -133,6 +133,10 @@ TestInstr(Mov)('RAX', mem('[0x1122334455667788]'))
TestInstr(Mov)('RAX', mem('gs:[0x1122334455667788]'))
TestInstr(Mov)('RAX', mem('gs:[0x60]'))
TestInstr(Mov)('RCX', 0x1122334455667788)
TestInstr(Mov)('RCX', -1)
TestInstr(Mov)('RCX', -0x1000)
TestInstr(Mov)('RCX', 0xffffffff)
TestInstr(Mov)('RAX', 0xffffffff)
TestInstr(Mov)('R8', 0x1122334455667788)
TestInstr(Mov)('RCX', -1)
TestInstr(Mov, immediat_accepted=-1)('RCX', 0xffffffffffffffff)