Loading absolute pointer to register via LEA

148 views Asked by At

How to load an absolute address to register via lea?
I tried this code:

asm.lea(asmjit::x86::rax, (uint64_t) (address));

And I try to use this code

asm.lea(asmjit::x86::rax, asmjit::x86::ptr((uint64_t) (address)));

But all of them don't work. Asmjit logged "Invalid use an 64-bit pointer". But if I code this code in flat assembler, it works (lea rax, QWORD_PTR [address]).

0

There are 0 answers