Get the latest tech news
Revisiting the DOS Memory Models
At the beginning of the year, I wrote a bunch of articles on the various tricks DOS played to overcome the tight memory limits of x86’s real mode. There was one question that came up and remained unanswered: what were the various “models” that the compilers of the day offered?
Similarly, an instruction like MOV AX, [5610h] assumes that the given address references the currently-selected DS so that it doesn’t have to express the segment every time. As you can imagine, this requires extra code on every memory access and thus huge pointers impose a noticeable tax on run time. And now that we know about 8086 segmentation, EXE files, and pointer types… we can finally tie all of these concepts together to demystify the memory models we used to see in old compilers for DOS.
Or read this on Hacker News