🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

CALL-instruction to constant 8-byte address

Started by
12 comments, last by Beosar 2 years, 2 months ago

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

That seems to be a 64 bit near call.

Advertisement

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.

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