flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > virtual at <register> unexpected error? |
Author |
|
bitRAKE 07 Jun 2009, 15:52
Okay, I see my error now.
".frame" will be larger than "$" - making the result negative. "rb .frame+rbp-$" also works as expected. |
|||
07 Jun 2009, 15:52 |
|
vid 07 Jun 2009, 16:46
why don't you just use "align" directive?
|
|||
07 Jun 2009, 16:46 |
|
bitRAKE 07 Jun 2009, 17:14
"error: section is not aligned enough"
...which seems odd, because: "section '$' code align 64 readable executable". Guess FASM doesn't know where RBP will be. "virtual at rbp-.frame" is the basis for the section, imho. |
|||
07 Jun 2009, 17:14 |
|
revolution 07 Jun 2009, 17:18
Virtual with a register offset can be tricky to work with, aligns don't seem to work. Also address arithmetic needs to be done in such a way so as to not end up with an intermediate sum that has a negative register value.
|
|||
07 Jun 2009, 17:18 |
|
bitRAKE 07 Jun 2009, 19:00
Prior to figuring it out I was using two virtual blocks: the first one from RSP to determine the frame size, and the second one to reference from RBP. Prior to that I just put the offsets manually, but updating the code in half a dozen places every change gets rather old - especially, when FASM can do all the hard work.
Now I just update in one place, and the virtual block also serves as terse documentation for the interface. The syntax is still flexible enough to insure byte offsets, or changing to RSP - with no difference in the code which relies on it. |
|||
07 Jun 2009, 19:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.