Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Make Variable Public
 Example                                   Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Syntax:   PUBLIC [langtype] name [,[langtype] name]...
 
  See also: OPTION PROC:PUBLIC, EXTERN, EXTERNDEF, COMM, .MODEL,
            OPTION LANGUAGE:, SEGMENT, PROC, /C<x>, /H, /Zf,
            Table of Memory Models, MASM 5.1 Compatibility
 
  Description:
 
     Makes one or more variables available to other modules in the
     program. PUBLIC names can be forward referenced.
 
     The following can be made PUBLIC:
 
        ■ NEAR and FAR code labels and procedures
        ■ Data created with user-defined types, BYTE, WORD, and other
          types
        ■ Data created with user-defined structures, unions, and records
        ■ Labels created with the LABEL directive
        ■ Symbolic constants created with EQU or =
 
     The PUBLIC directive is normally used with the EXTERN directive.
     The EXTERNDEF and COMM directives allow more flexibility in
     global data declaration than the PUBLIC and EXTERN directives.
     One use is illustrated below.
 
                  ┌──────────────────────────────────┐
                  │                                  │
     ┌─USER.ASM───┴───────────┐        ┌─TOOLS.ASM───┴──────────┐
     │                        │        │                        │
     │ EXTERN global:WORD     │        │         PUBLIC  Global │
     │                        │        │ Global  WORD    5      │
     └────────────────────────┘        └────────────────────────┘
 
     Parameter      Description
 
     langtype       Any language type. Used to control what format
                    label names are sent to the linker.
                    See: language type
 
     name           The name of a variable, label, or numeric equate
                    defined within the current source file
                                    -♦-