flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
DOS386
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 ? |
|||
![]() |
|
Tomasz Grysztar
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). ![]() |
|||
![]() |
|
revolution
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 |
|||
![]() |
|
Tomasz Grysztar
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.
|
|||
![]() |
|
revolution
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. |
|||
![]() |
|
DOS386
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 ![]() |
|||
![]() |
|
f0dder
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... |
|||
![]() |
|
Japheth
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. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.