6ar453v3n wrote:If I write a "hello world" program for DOS, about how many bytes would the executable be?
16-bit ASM: cca 20 Octet's
16-bit HLL: cca 1 KiO to 10 KiO
32-bit HLL: cca 30 KiO to 300 KiO
Quack-64: cca 10 MiO (YES it runs in DOS
http://www.bttr-software.de/forum/board ... hp?id=8785)
This had been discussed already 1'000'000'000'000 times:
-
http://www.freebasic.net/wiki/wikka.php ... DOS#item24
-
http://freebasic.net/forum/viewtopic.php?t=11757 (2008-Jul)
-
http://www.bttr-software.de/forum/board ... p?id=13629
Q: Why are DGJPP FPC FBC executables bloated?
A: Because the compiler toolset (actually the linker) adds much garbage to your code:
- DOS extender or loader of it and startup code
- exception handling
- commandline globalization
- source level Linux emulation (DGJPP and derivatives)
- C library (except FPC)
- PASCAL library (only FPC)
- NTVDM + NTLFN garbage
- FPU initialization and emulation, even if your code does not have a single float variable or operation
- calendar
- list of outdated junk DOS kernels
- debug stuff
- empty areas ("alignment optimization")
- QB compatibility + FB dialect stuff (only FBC)
- TP/BP and Delphi compatibility stuff (only FPC)
...
(and much more)
Q: Can it be made better?
A: YES, but nobody cares.
Q: Can I reduce the size of my EXE's without changing the compiler?
A: YES, slightly, see link above.
Q: Should I pack my executables with UPX?
A: There is no final correct answer. Be aware that UPX doesn't remove any bloat, it just compresses existing one, and adds the decompression stub (in fact extra bloat). This had been discussed already 1'000'000'000'000 times:
-
http://www.xaver.me/drdoswiki/index.php ... ress#toc20
-
http://wiki.freepascal.org/Size_Matters