Have a doubt regarding the hex code conversion of JMP machine instruction. I have the absolute address I want to jump to, say "JMP 0x400835". First of all, is this allowed? If yes, what would be the corresponding hex code? If not, can I first store the address in some register, say EAX and then put "JMP EAX"? I am working on x86(64b) architecture.
I have tried to print out the hex code from the diassem output in gdb, but there is no consistency, ie, I do not see the destination address in the hex code.
I am new to hex code and machine instructions, so pardon my ignorance.
ld
on Linux) will assemble+link a jmp to an absolute address as a relative jmp from a known address (in position-dependent code). – Flyfish