News for hackers. Stuff that matters.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by WalterBright on Monday October 31, 2022 @02:39AM (#33402674)
Fun fact. The COM file size was limited to 64K. The program size was not. Most COM memory models set CS=DS=SS=ES. However, the Zortech C compiler, would have CS set differently.

CS pointed to the start of the code segment, DS to the start of the data segment. As long as the code segment plus the initialized data of the data segment was less than 64K, you could have a considerably larger runtime footprint (up to 128K) and still be a COM file with all near pointers.

Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by stkdump on Monday October 31, 2022 @03:41AM (#33402999)
Actually, .com files can be larger. I don't know how exactly it was handled, but I distincly remember seeing versions of edit.com >64k
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by andrewshadura on Monday October 31, 2022 @03:55AM (#33403093)
They were .exe internally.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by WalterBright on Monday October 31, 2022 @04:24AM (#33403234)
I'm not sure when it started, but the .com and .exe extensions were ignored, and the loader looked at the first two bytes to see if it was "MZ" and was an exe file.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by sumtechguy on Monday October 31, 2022 @08:15AM (#33404693)
I like that every windows exe/dll still have the MZ on the front. Also a working DOS program there in the first hundred bytes which is pretty much a program to say 'hey run this in windows'. As the real windows header is 100 bytes in.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by teh_klev on Monday October 31, 2022 @07:05AM (#33404191)
There was a technique that used a thing called overlays[0]. You could write a program that is much larger than the available address space (64k on MS/PCDOS) but you split it up into functional areas or modules that are loaded on demand into a reserved area of your 64k address space.

[0]: https://en.wikipedia.org/wiki/Overlay_(programming)