Advertisement

CALL-instruction to constant 8-byte address

Started by April 25, 2022 03:48 PM
12 comments, last by Beosar 2 years, 7 months ago

Try OpCode FF /2: https://www.felixcloutier.com/x86/call

That seems to be a 64 bit near call.

Beosar said:
Try OpCode FF /2: https://www.felixcloutier.com/x86/call​

Yes, thats what I've been doing originally. But it requires using a separate MOV into the rax-register, which makes the code a bit worse to decypher (which I currently really need to be able to) and it also uses an indirect call which has the potential to be slower.

Advertisement

Oh, sorry. So, basically you are generating code and storing it in memory on the heap. I don't think there is a guarantee that the address is within range of your program's code. It may work on one OS on one machine but not on another. You could potentially copy the program's code to the heap and then put the JIT compiled code directly after that, then it would definitely be in range (unless your program gets very large).

This topic is closed to new replies.

Advertisement