Re:Exploring Object File Formats
by eterps on Tuesday January 16, 2024 @06:41AM
(#39012181)
I have a soft spot for the brutal simplicity of the .COM format.
[ Parent
| on HN ]
Re:Exploring Object File Formats
by 082349872349872 on Tuesday January 16, 2024 @08:50AM
(#39013241)
Both ELF and Mach-O (and presumably other recent formats) are amenable to a pseudo-COM approach: https://news.ycombinator.com/item?id=38593896
Re:Exploring Object File Formats
by actionfromafar on Tuesday January 16, 2024 @09:58AM
(#39013926)
Also see the pure brutality that is the early Microsoft Office DOC file. :)
Just dumping the memory IIRC.
Re:Exploring Object File Formats
by fullspectrumdev on Tuesday January 16, 2024 @11:13AM
(#39015014)
I vaguely recall reading that on some versions of Office way back when, memory from other programs would sometimes leak into saved document files.
(Pauses commenting to go check) yes it’s referenced in Chapter 3 of “Silence on the Wire”, apparently Office on Windows 95/98 would dump memory from “other programs” into word docs, with some anecdotal sightings in later versions.
Re:Exploring Object File Formats
by actionfromafar on Tuesday January 16, 2024 @11:41AM
(#39015325)
Maybe a case of reused allocated memory and just writing chunks of memory to disk. Simplistic example:
struct blah_block{ int sz; char buf[510]; }
Re:Exploring Object File Formats
by WalterBright on Tuesday January 16, 2024 @01:58PM
(#39017299)
What's interesting about that is every tool I've seen to generate .com files would set SS=DS=ES=CS to the same value.
But, it turns out, this is not necessary. The only thing about COM is that the file size has to be less than 64K. This enables another memory model, where the code seg and data seg are different, enabling substantially larger programs that were still COM programs. This was the Zortech "small" memory model.