Assembly Language Help (alang.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Flat Memory Model: Details
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The flat memory model creates a program that contains one 32-bit
segment for program data and program code. The code generated
with the flat-model option will run only on 80386/486 processors.
A .386 or .486 processor directive must precede the .MODEL directive
that specifies the flat memory model.
This memory model causes the assembler to produce files with the
.EXE extension.
All segment registers are automatically set to the same value
with this memory model. The defaults in flat-model programs are
NEAR code addressing and NEAR data addressing. The PROC distance
is NEAR under the flat-model option. @CodeSize is 0, @DataSize is
0, and @Model is 7.
The FS and GS segment registers are not needed for flat-model
programs. The .MODEL FLAT statement automatically generates this
assumption:
ASSUME cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT, fs:ERROR, gs:ERROR
When defining segments with the SEGMENT directive, you should use
this ASSUME in your code.
See also: .MODEL, COMM, EXTERN, .386, .486
-♦-