1

I was reading https://stackoverflow.com/a/3723153/97248 about how DOS loads an .exe file. There is the minimum required memory (== additional memory) field in the .exe header (at offset 10). When this is nonzero, does DOS fill this part of memory with 0s before calling the entry point of the program?

DOSBox 0.74-3 seems to be filling it with 0s.

pts
  • 80,836
  • 20
  • 110
  • 183
  • You may have to test it (possibly with different DOS versions) to be sure. My guess would be no. If the program doesn't need the memory zeroed, this would waste time (many milliseconds on an 8088), and if it does, it can do it itself in its startup code. Modern operating systems zero memory to ensure it doesn't contain anything sensitive, but on a machine without memory protection, this is pointless. – Nate Eldredge Jun 24 '20 at 18:40
  • 2
    Related question on Retrocomputing: https://retrocomputing.stackexchange.com/questions/12027/did-dos-zero-out-the-bss-area-when-it-loaded-a-program/12030#12030 – Ross Ridge Jun 25 '20 at 05:54

1 Answers1

0

The answer is no. More details, including assembly code to manually zero-initialize the additional memory (.bss) are in the answer linked in @RossRidge's comment: https://retrocomputing.stackexchange.com/questions/12027/did-dos-zero-out-the-bss-area-when-it-loaded-a-program/12030#12030

pts
  • 80,836
  • 20
  • 110
  • 183