Slide 13.2: Local variables
Slide 13.4: INVOKE directive
Home

.MODEL Directive


The .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, STDCALL
Memory Model
The 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.

Model Options
The 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: