Quantcast
Channel: what determines the memory model? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Ernest Friedman-Hill for what determines the memory model?

$
0
0

COM files used a "flat memory model" in the sense that the segment registers were alll set by DOS when the program was loaded to point to the same segment, and all the code and pointers were, by convention, relative to that one value in the segment registers.

The EXE file format, on the other hand, allows for segments to be loaded at different offsets. DOS wouldn't set the segment registers to default values; that was up to the code itself. 16-bit EXE code is a lot more complex because the code has to manage segment registers.

Nowadays a lot of EXE code more or less ignores segment registers again; 32 or 64-bit registers don't need to be added to a segment register to generate a usable address.


Viewing all articles
Browse latest Browse all 4

Trending Articles