Tuesday, April 12, 2005

lovely windows API

Here we go... after winning a bit of laziness I implemented a windows' version of my mandelbrot zoomer. It's 20K (about 30 times bigger than then DOS version) and does more or less the same thing.... ok... I'm a bit unfair to windows; this new version has a better palette and a better image quality and also it was written in a C/asm mix because I'm way too lazy to write under windows in pure assembler.

NEWS: I've to eat my words about how fat windows executables must be; it turned out that it's the standard C initialization code inserted by default by VC++ that is fat. Removing that initialization code the program size went down to a 16Kb that UPX is able to shrink into less than 5Kb.

1 comment:

6502 said...

Big news... reading a diskmag about how to write intros for windows I discovered that the extra code is just initialization code (command line parsing and things like that) that can be removed setting properly VC++ options if you don't use the standard C library. Playing some small extra trick and calling UPX on the result the code size for the windows version is now down to 4608 bytes. To get smaller one must got to a .COM file (com files have no headers) playing very bad tricks (like creating a .exe on the fly, calling it and then deleting it)