3 ms·
As someone who wrote 16-bit x86 Asm for a long time, if you are writing Asm by hand, the "tiny" model is not as tiny as it may sound at first glance --- 65,536
by userbinator 6y ago
As someone who wrote 16-bit x86 Asm for a long time, if you are writing Asm by hand, the "tiny" model is not as tiny as it may sound at first glance --- 65,536 bytes seems very far when you can write useful applications starting in the dozens of bytes and going up to a few KB. A "Hello World" is around 21 bytes, half of which is the message itself. The majority of the executables that came with MS-DOS 6.22 are under 64K as well, despite being written in C.
Then I look at the Win32 C equivalent with the default MSVC compiler options, and it's over 64KB already...
- jchw 6y agoFWIW: it’s trivial to make minimal binaries, just, nothing optimizes for it for the most part. If you use OpenWatcom v2 with nodefaultlib you can get win32 binaries that are around ~1500 bytes, which is not too shabby when you consider its padded to 512 byte boundaries, and that the PE headers take at least 300 bytes or so if you aren’t overlapping structures. I have a project that implements a regular expression engine, JSON parser and some game patching code into a DLL that is around 10 KiB (iirc) using OpenWatcom. Of course it’s easy if you’re only targeting Windows and 32 bit but you can do similar if you drop the standard library in MSVC.
- wruza 6y agoOh yes, "This program cannot be run in DOS mode". Decades have passed, but Microsoft still has not learned how to make them run.
- temac 6y agoThe majority of ms dos was written in assembly language. Even 6.22