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.
Localize Label
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Syntax:   OPTION SCOPED
 
            OPTION NOSCOPED
 
  See also: PROC, LABEL, Colon (:/::)
 
  Description:
 
     The SCOPED option causes a label (defined with the "label:" syntax)
     to be local to the procedure in which it is defined. Labels defined
     with the LABEL directive or the "label::" syntax are not affected by
     this option.
 
     Using NOSCOPED will cause all labels to be global to the module.
     SCOPED is the default. The NOSCOPED option is enabled with the
     M510 option, if the .MODEL directive is used without a language type
     specification. Specifying .MODEL with a language type enables
     OPTION SCOPED.
 
     Without a language type, MASM 5.1 assumes code labels in procedures have
     no scope--that is, the labels are not local to the procedure. When not
     in compatibility mode, MASM 6.1 always gives scope to code labels, even
     without a language type.
 
     To force MASM 5.1 behavior, specify either OPTION M510 or OPTION NOSCOPED
     in your code. To selectively enable MASM 6.1 behavior, place the dir-
     ective OPTION SCOPED after OPTION M510.
 
     To determine which labels require change, assemble the module without the
     OPTION NOSCOPED directive. For each reference to a label that is not
     local, the assembler generates error A2006.
                                    -♦-