Slide 13.2: Local variables Slide 13.4: INVOKE directive Home |
.MODEL
Directive
.MODEL
directive determines several important characteristics of a program: its memory model type, procedure naming scheme, and parameter passing convention.
The syntax of the .MODEL
directive is
.MODEL memorymodel [, modeloptions]
For example,
.model flat, C .model flat, STDCALLMemory Model
memorymodel
field can be one the the models described in the table.
Model | Description |
---|---|
Tiny |
A single segment, containing both code and data. |
Small |
One code segment and one data segment. |
Medium |
Multiple code segments and a single data segment. |
Compact |
One code segment and multiple data segments. |
Large |
Multiple code and data segments. |
Huge |
Same as the large model, except that individual data items may be larger than a single segment. |
Flat |
Protected mode. Uses 32-bit offsets for code and data. |
modeloptions
field includes a language specifier, which determines calling and naming conventions for procedures and public symbols.
There are two kinds of language specifier options:
C
, BASIC
, FORTRAN
, and PASCAL
specifiers enable assembly language programmers to create procedure that are compatible with these languages.
SYSCALL
and STDCALL
specifiers are variations on the other language specifiers.