flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Using rip relative addressing for branch optimations |
Author |
|
bitRAKE 06 Jan 2010, 15:08
LEA gets the address, MOV gets the content at address, but your words seem to indicate you need something like?
Code: mov r12,[rip+n] mov r12,[r12] |
|||
06 Jan 2010, 15:08 |
|
Mat 06 Jan 2010, 15:15
thanks, the solution was
Code: mov rdx, address lea r12,[rip+2] jmp rdx return is then simply: Code: jmp r12 the extra mov was necessary because I handle with 64 bit linear addresses (and the call routine can be mapped above 4 GB theoretically). -Mat. |
|||
06 Jan 2010, 15:15 |
|
bitRAKE 07 Jan 2010, 03:09
Any routine which gets called more than once would benefit (in terms of code size and cache useage) from a vector table:
Code: Table: ... dq address ... lea r12,[rip+6] jmp qword [rip+index] |
|||
07 Jan 2010, 03:09 |
|
Mat 08 Jan 2010, 19:15
I know and using these technique for token-threading interpreters (Forth) but this time the target is an JIT compiler which generates native code (again Forth) so because code addresses are only known at compile time the only sense for it would be something like an address cache and this wouldn't be worth the effort.
Regards, Mat. |
|||
08 Jan 2010, 19:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.