x86_64 64 bit immediate move
I am writing the instruction below.
movq开发者_开发百科 $TARGET_CIA, %rcx
TARGET_CIA
is an undefined variable so is treated as zero. This instruction's disassembly looks like
0: 48 c7 c1 00 00 00 00 mov $0x0,%rcx
At run time, I want to replace this $TARGET_CIA
with a 64-bit value by copying the 64-bit value to the offset of TARGET_CIA
symbol. Please let me know how this can this be done.
In fasm you would achieve that with "mov [qword 0], rax". Note that AL, AX, EAX, RAX are the only registers allowed to be the source or destination of an instruction with 64-bit absolute addressing so you won't be able to use RCX here (copy the value to RAX)
If your assembler has no means to force full addressing, then use:
db 0x48, 0xA3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
精彩评论