flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 11 Aug 2006, 10:13
hmm, "format pe align 32" might be added, but how to distinguish file align and memory align?
|
|||
![]() |
|
shoorick 11 Aug 2006, 10:30
"pealign" "alignsect(ion)"
|
|||
![]() |
|
vid 11 Aug 2006, 10:36
ugh... new keywords
![]() or "format PE align 200h, 1000h" :DDD no new keywords |
|||
![]() |
|
GR-K 11 Aug 2006, 11:02
Anyway PE formatter does not support align directive.
Assembler don't need to distinguish them. Simply, file align means how many nulls will be added to the end of executable ![]() P.S.: I know only two ways to get executable with a file alignment smaller than 200h. 1st, is to write RAW PE, and 2nd is to use "format PE native" directive and then change subsystem manually. |
|||
![]() |
|
revolution 11 Aug 2006, 14:04
On disk the file will still occupy 4k minimum unless you are storing the file on a floppy. So a file size of 812 bytes is really going to be 4096 bytes anyway.
|
|||
![]() |
|
GR-K 12 Aug 2006, 06:06
Sure that is. Do you think that it is better to download an 4KB file? As assembler coder I like to write programs as small as possible. Don't you?
It is bad that when I am coding in my favorite assember, I need to cut all this nulls and set 4B alignment up manually. Because of it I am asking Tomasz for adding directive that will change default PE file alignment. |
|||
![]() |
|
chris 12 Aug 2006, 15:05
Maybe fasm's default value (0x200=512) for a non-native PE image is somehow optimized for disk access, since most disks have sector size of 512 bytes.
|
|||
![]() |
|
GR-K 12 Aug 2006, 16:03
Disk access? No. Simply, 200h bytes it is minimal aling value for w9x systems. And EXE with smaller alignment will not work on them. It means that your program will incompatible with older OS versions. The reason for adding directive that will change standart alignment value is that most of modern programs written directly for NT/W2K/XP systems and it will help to get smallest executables.
|
|||
![]() |
|
Tomasz Grysztar 12 Aug 2006, 18:00
It may make sense to allow custom file alignment, though for memory alignment alignments smallers that 4 kilobytes are not a good idea - the system wouldn't be able to apply the page attributes correctly for each section.
The reason why it's not implemented yet is that it would require rewriting some bits of PE formatter and thus it's not really a quick and easy addition. The PE formatter is one of the few parts of fasm that never got completely rewritten and remains really only a bit altered in general design since it's introduction in fasm 1.04 - and the time the PE documentations I had allowed no file alignment smaller than 200h. Later I inclined it a bit to make the "native" be handled differently, but it's still a bit of a special case - at the same time I tried preparing it allow custom alignment, but few details prevented me from finishing. But, since it's actually the first time that this feature is openly requested, I'm motivated to get back to it. |
|||
![]() |
|
vid 12 Aug 2006, 20:37
tomasz: and what about syntax for it?
|
|||
![]() |
|
Tomasz Grysztar 12 Aug 2006, 20:43
Your suggestion was good IMO, as I noted it would be only the file alignment to be adjusted.
|
|||
![]() |
|
GR-K 13 Aug 2006, 07:33
Thanks for reply, and thanks for your work.
It's easy to change align manually (and then cut off all not needed nulls), and everybody (or not?) can change hardcoded values in sources, but it will better to have customizable PE formatter. Tnx again, I'll wait :) |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.