I did this once in FASM just for fun. Thought I would try to create a plain Window
with as small a footprint as possible. Also experimented with reducing size of
the WndProc, an un-balanced stack, direct access of stack variables and such.

I seem to have stumbled upon something odd though.

Normally, when I compile this code I end up with an exe of 1536 bytes
(all of case 1 uncommented while case 2 is commented).

However, when I comment out case 1 and uncomment case 2 (supposedly to
further reduce code size at the expence of a cursor and icon), it ends up
being larger than before :confused:

Perhaps someone might look at it and explain to me this weird behaviour?
Posted on 2003-10-18 15:21:42 by Graebel
with standart options the size become 2,560Bytes of size.
linked with "Macro Assembler Version 6.14.8444"

Greets !
Posted on 2003-10-18 15:30:45 by Bubu-Boy
hmm weird behaviour. I cannot really explain it. Perhaps alignment issue? erm this is fasm code?

Anyway you can remove the call to GetModuleHandle and replace it with 400000h. Also you can remove the data section and change



push OFFSET szDisplayName


to


call @F
db "template",0
@@:
Posted on 2003-10-18 23:54:40 by roticv
Here is the final executable reduced to 1536 bytes with the source code intact.
Posted on 2003-10-19 03:57:33 by Vortex