Cr0a3/ygen

[BUG] Invalid rex prefix for mov instruction

Closed this issue · 1 comments

Describe the bug
Following code:

mov r10, 6
lea rax, [ rdi + r10 ]

gets compiled but with the wrong rex prefix so the dissassembly looks like that:

48c7c206000000          mov     rdx, 6
4a8d0417                     lea     rax, [rdi + r10]

But the valid opcode for mov r10, 6 would be:

0x49c7c206000000

Where rex is:

0b1001 // Rex.WB

REX.W means 64bit instruction