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.
Local Variables in Procedures
 Example                                   Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Syntax:   LOCAL name [[count]][:qualifiedtype] [, name [[count]]
            [:qualifiedtype]]...
 
  See also: LOCAL in Macros, PROC
 
  Description:
 
     Generates code to create one or more stack (automatic) variables,
     which can be accessed only within the current procedure. The
     assembler uses the same method used by high-level languages to
     create local variables.
 
     The <name> parameter is the name of the variable, and <count> is
     an optional expression (which must appear in square brackets)
     indicating the number of elements to allocate. The <qualifiedtype>
     parameter is any qualified type appropriate to <name>. The default
     <qualifiedtype> is WORD in a 16-bit segment and DWORD in a 32-bit
     segment.
     See: qualified type
 
     Once declared in a LOCAL statement, local variables can be
     referred to by name. The assembler translates references to these
     variables into references to their actual location on the stack
     using the BP indirect addressing mode.
 
     The assembler will generate an error if you have already defined
     <name> as a label.
 
  Example:
 
     LOCAL     array[20]:BYTE
                                    -♦-