flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Calculate RVA for JMP |
Author |
|
revolution 05 May 2021, 19:55
FlierMate wrote: So how do I calculate the length of JMP (in bytes) for each of these conditional instruction? Do I need 2 pass, 3 pass,etc to first find out the size of code block in between as illustrated below? <snip> Otherwise, for single pass, you can keep a list of unknown targets and fill in the distance when you encounter the future address. As long as you always leave enough space in the originating jmp then it works. But if you try to reserve only a 2-byte jmp and the forward distance is more than 127 bytes then it fails, so you have to reserve a 5-byte jmp instead and sometimes have 3 extra bytes doing nothing of value. |
|||
05 May 2021, 19:55 |
|
Tomasz Grysztar 05 May 2021, 20:54
For a multi-pass approach, I have written an article that explains what fasm does to generate correct relative values.
|
|||
05 May 2021, 20:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.