flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > zeroalign directive |
Author |
|
DOS386 23 Oct 2010, 07:59
http://board.flatassembler.net/topic.php?t=1570 Jibz "align with 00h bytes?"
http://board.flatassembler.net/topic.php?t=8632 Grom PE "Raw PE format again" Any chance for the zeroalign directive in FASM 1.70 ? |
|||
23 Oct 2010, 07:59 |
|
Tomasz Grysztar 23 Oct 2010, 10:38
fasm manual, section 2.2.5:
Quote: If you need to fill the alignment area with some other values, you can combine align with virtual to get the size of alignment needed and then create the alignment yourself, like: And it's easy to make it into macro (I leave it as an exercise to the reader). You may also need to replace "0" with "?" if you plan to use that align in reserved data space as well. |
|||
23 Oct 2010, 10:38 |
|
revolution 23 Oct 2010, 11:20
Here you go:
Code: macro align ment*,dat { local a if ~ dat eq virtual align ment a=$-$$ end virtual db a dup dat else align ment end if } Last edited by revolution on 23 Oct 2010, 11:29; edited 1 time in total |
|||
23 Oct 2010, 11:20 |
|
Tomasz Grysztar 23 Oct 2010, 11:27
But it fails to emulate the standard "align" directive properly. You should just make it fall back to default "align" directive when "dat" is empty.
|
|||
23 Oct 2010, 11:27 |
|
revolution 23 Oct 2010, 11:30
Tomasz Grysztar wrote: But it fails to emulate the standard "align" directive properly. You should just make it fall back to default "align" directive when "dat" is empty. |
|||
23 Oct 2010, 11:30 |
|
DOS386 24 Oct 2010, 00:49
Tomasz Grysztar wrote: If you need to fill Thanks, I've been aware of this (see many of my examples), still, an "internal" solution would be cool. PS: of course it could be even worse: http://www.bttr-software.de/forum/forum_entry.php?id=8979 |
|||
24 Oct 2010, 00:49 |
|
f0dder 24 Oct 2010, 16:05
http://www.bttr-software.de/forum/forum_entry.php?id=8979 wrote: > 2. There are some aligns inside the binary and they contain random garbage Ugh, that's NASTY - I once had pieces of source code show up in an executable because the compiler didn't zero out allocated memory... |
|||
24 Oct 2010, 16:05 |
|
Japheth 25 Oct 2010, 05:43
f0dder wrote:
It works ok, because there are no "random" values under Windows, Linux or MS-DOS. It's just a few wannabee-DOS-compatible OSes like FreeDOS or EDR-DOS which - once more - take this opportunity to prove that they are toys. |
|||
25 Oct 2010, 05:43 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.