News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

making smallest 32-bit "Hello World" application

Started by white scorpion, March 28, 2005, 05:33:25 PM

Previous topic - Next topic

hutch--

The pursuit of size reduction in an exe file by code size minimisation has always made me laugh. A toy of mine called TheGun was an example of size reduction by any method possible including compression but apart from normal minimum code to perform the task, the successful methods were in architecture, not chasing bytes in code.

I once spent a couple of hours on a copy of TheGun doing every trick to reduce the code size even further, register replacements for immediate variables and the like and at the end of the effort, I could not get its size down by a single 512 byte section. Now it already has all of the dirty tricks, no DATA section, all of the static string data is at the start of the code section before the start label and with another version, I wrote the string data in a dead area at the end of the PE header. I used a dynamic jump table to get the actual code size down and it still stubornly sits at 6k finished.

For all of the effort and no size gain, an already difficult to read source became more or less unintelligible to anything else than an assembler so I gave up on the idea. After adding some additional functionality to it where it grew by 1 512 byte section, it was Pelle's linker that droped it back to 6k.

Sooner or later you get the idea that byte size reduction at a code level does not deliver the goods.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

white scorpion

Already have that idea, so i gave up as well.. The only interesting thing in improving IMO is for speed when writing a routine which will be called a couple of million times. This is definitely worth improving, but since i can see no real use for it now i think i'll just still with the default linker options and with the normal coding style  :wink