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.
Initialize Memory Model
 Example                                   Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Syntax:   .MODEL memorymodel [,langtype] [,ostype] [,stackoption]
 
  See also: .CODE, .DATA, .STACK, ASSUME, GROUP, EXTERN, PUBLIC,
            PROC, PROTO, @CodeSize, @DataSize, @Model, @Interface,
            .MODEL with .386 and .486, MASM 5.1 Compatibility
 
  Description:
 
     Initializes the program memory model. Must be placed at the
     beginning of the source file before any other simplified segment
     directive. Generates ASSUME and GROUP statements used by the
     specified memory model. Also creates the predefined equates for
     the various simplified segments. The .MODEL directive can occur
     only once in a program.
 
     If you use the langtype argument with .MODEL, nested procedures
     are not allowed.
 
     Parameter      Description
 
     memorymodel    TINY, SMALL, COMPACT, MEDIUM, LARGE, HUGE, or
                    FLAT. If you are writing an assembler routine for
                    a high-level language, this option should match
                    the memory model used by the compiler or
                    interpreter. FLAT is valid only in .386 or .486
                    mode. You must use the /AT command-line option or
                    /TINY linker option to assemble tiny-model programs.
                    See: Memory Models
                         /AT command-line option
 
     langtype       Any language type. Instructs the assembler to
                    follow the naming, calling, and return conventions
                    for the indicated language. This affects the
                    PUBLIC, EXTERN, PROC, PROTO, and INVOKE
                    directives.
                    See: language type
 
    ostype         OS_DOS is the only option currently supported
                    and is the default.
                    See: .STARTUP
 
     stackoption    NEARSTACK (if SS equals DS) or FARSTACK (if SS is
                    not equal to DS). NEARSTACK is the default. The
                    stack is not part of DGROUP with the FARSTACK
                    option. This affects the code generated by the
                    .STARTUP directive.
                                    -♦-