<<< Small, Medium, Compact, Large, and Huge Models | Index | Creating a Stack >>> |
The flat memory model is a non-segmented configuration available in 32-bit operating systems.
Flat model is similar to tiny model in that all code and data go in a single 32-bit -addressable block of memory.
To write a flat model program, specify the .386 or .486 directive before .MODEL FLAT:
.386 .MODEL FLAT ; All data and code, including system resources, are in a single 32-bit segment.
The operating system automatically initializes segment registers at load time.
A program may need to modify segment registers only when mixing 16-bit and 32-bit segments in a single application.
CS, DS, ES, and SS all occupy the supergroup named FLAT.
Addresses and pointers passed to system services are always 32-bit near32 addresses and pointers.
Flat model does not require far addresses. By default, all addressing is relative to the initial values of the segment registers.
Therefore, far addressing does not apply to flat model programs.
<<< Small, Medium, Compact, Large, and Huge Models | Index | Creating a Stack >>> |