flat assembler
Message board for the users of flat assembler.
Index
> Main > How to align SSE variables |
Author |
|
Reverend 13 Sep 2005, 15:17
Although my macro posted below works alright, I had to use virtual, and don't have an idea why doesn't it work the way you had it.
Code: macro dalign value { local __ADDR virtual dd $ load __ADDR dword from $-4 end virtual rb value-(__ADDR mod value) } |
|||
13 Sep 2005, 15:17 |
|
Tomasz Grysztar 13 Sep 2005, 15:49
Quote: I've tried align 16, but it reports "section is not aligned enough". This means you have to align the section first - when section is not aligned on 16 bytes boundary, aligning the data relatively to the beginning of this section is useless. For the same reason you cannot use $ symbol this way, since assembler doesn't know at what address this section will be put by the linker/loader. To align the section, you declare it like: Code: section '.data' data readable writeable align 16 This tells the linker that this section should be put at aligned address; and thus assembler can do "align 16" and smaller alignments inside such section without problems (and in the beginning of section you even don't have to do additional alignment). |
|||
13 Sep 2005, 15:49 |
|
SDragon 14 Sep 2005, 00:49
Thank you very much, Tomasz. It works!
|
|||
14 Sep 2005, 00:49 |
|
Reverend 16 Sep 2005, 20:56
Tomasz: Why is it so? Sections in PE are aligned always to at least 512, so I guess all alignments in sections below that value should be possible. I agree with your point of view (as I understand it), but only for alignment values greater than the default 512.
|
|||
16 Sep 2005, 20:56 |
|
vid 15 Feb 2006, 15:45
while revising old thread i found this unanswered question interesting... Tomasz?
|
|||
15 Feb 2006, 15:45 |
|
Tomasz Grysztar 15 Feb 2006, 15:58
The sections in COFF are not the same thing as sections in PE - the linker may compose the final PE section out of many COFF sections of the same name, and when it concatenates them, it uses the alignment specified for each of them.
|
|||
15 Feb 2006, 15:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.