I just noticed that data in the data section appears in the .exe for the program.

The data is declared using 'rb', rw', and 'rd' in the data section:

section '.data' data readable writeable

data1 rb 100
data2 rb 100

This is a problem to me because the program in question has over 250,000 bytes of 'rb' data which effectively doubles the .exe size to over 500,000.
Posted on 2002-11-30 22:31:21 by msmith
500,000 bytes are just 488kb!
if you have regular ("everywhere the same") data, you can define it uninitialized and fill your data at startup.
Posted on 2002-12-01 10:35:50 by hartyl
The data IS unitialized data... Look at my example code!

It should NOT appear as an increase in the size of my .exe file... IT DOES.

On smaller programs, this does not occur. Only on this large program does it occur.

It appears that there may be a bug in handling unitialized data (rb, rw, rd, etc.) after it reaches a certain size. Is that size 65535? Just a guess.

FASM is a very nice, professional program in most every respect. It is not fitting that unitialized data be grouped with code in the exe file.
Posted on 2002-12-01 11:14:51 by msmith
I haven't noticed any bug with that. Be sure you don't define any initialized data or code after the uninitialized one inside the same section, if the problem is not because of that, please show some example source that causes it.
Posted on 2002-12-01 15:59:33 by Tomasz Grysztar
Hi Privalov

I take the same, not in the PE but in DOS executables.


format MZ

segment sDATA

Data1 rb 100000

segment sCODE



Maybe it's because of limitations of the DOS EXE file format?
Posted on 2002-12-02 08:55:07 by JohnFound
Yes, that's because uninitialized data must be put at the end of MZ executable, in MZ header you have specified the amount of additional memory program needs after the data loaded from the file and this is the only way to declare uninitialized data in this format.
Posted on 2002-12-02 08:59:48 by Tomasz Grysztar