-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code_asm: expose rip/eip regs #212
Comments
I just ran into this in my Rust project. Would it be difficult for a newcomer to implement? It looks like AsmMemoryOperand::displ and Instruction::mem_displ are overloaded to contain a displacement or a label ID and I'd have to separate them somehow. |
It could be easy, I don't remember all the details. You can try this:
|
That doesn't work by itself, the displacement is interpreted as an instruction index if it's a valid index, and used as a literal displacement without adjustment otherwise: displ -1 |
Try updating to_memory_operand() in mem.rs and set displ_size to 8 if base is RIP, will that work? If that doesn't work, I'd compare the |
It's possible to use rip-relative addressing if you reference a label. It should be possible to do the same thing if you want to use any address (assuming it's close enough to the generated code).
#209
The text was updated successfully, but these errors were encountered: