jmp far
doesn't take a qword memory operand, it takes an 80-bit m16:64
operand to be loaded into CS:RIP.
I think you want to leave out the far
and use an indirect near jump that only modifies RIP, not CS. You say you want JMP r/m64
, and that's what this is.
In NASM syntax, qword
is the default operand-size for indirect jumps:
default rel
label:
jmp [rel label]
Assembles + disassembles (objdump -drwC -MIntel
) to this:
ff 25 fa ff ff ff jmp QWORD PTR [rip+0xfffffffffffffffa] # 401000 <label>
See also Call an absolute pointer in x86 machine code if you pointer is an assemble-time constant, e.g. for JIT. (e.g. mov rax, 0x123456789ab
/ jmp rax
or call rax
is also an option.)