digitalmars.D.learn - Is there a way to load a `RIP` register relative address in inline
- Stefanos Baziotis (3/3) Jun 18 2019 I can't do for example:
- Adam D. Ruppe (8/11) Jun 18 2019 The general trick in x86 assembly for this is
- Adam D. Ruppe (3/4) Jun 18 2019 errr you can see my 32 bit bias here (forgive me, I'm old), but
- Stefanos Baziotis (4/8) Jun 18 2019 Thank you, quite clever.
I can't do for example: lea RAX, [RIP+something]; Generally, RIP does not seem to be available.
Jun 18 2019
On Tuesday, 18 June 2019 at 16:56:18 UTC, Stefanos Baziotis wrote:I can't do for example: lea RAX, [RIP+something]; Generally, RIP does not seem to be available.The general trick in x86 assembly for this is call next; next: pop EAX; The call instruction pushes RIP to the stack (for a future ret instruction) but if you put it right where you are, you can simply pop it right back off the stack into another register.
Jun 18 2019
On Tuesday, 18 June 2019 at 17:09:48 UTC, Adam D. Ruppe wrote:pop EAX;errr you can see my 32 bit bias here (forgive me, I'm old), but you know what i mean :)
Jun 18 2019
On Tuesday, 18 June 2019 at 17:10:50 UTC, Adam D. Ruppe wrote:On Tuesday, 18 June 2019 at 17:09:48 UTC, Adam D. Ruppe wrote:Thank you, quite clever. There is also the "$" symbol that is related: https://dlang.org/spec/iasm.html#special_symbolspop EAX;errr you can see my 32 bit bias here (forgive me, I'm old), but you know what i mean :)
Jun 18 2019