GBLA, GBLB, and GBLC instructions

Use the GBLA, GBLB, and GBLC instructions to declare the global SETA, SETB, and SETC symbols you need. The SETA, SETB, and SETC symbols are assigned the initial values of 0, 0, and null character string, respectively.

Read syntax diagramSkip visual syntax diagram                                  .-,---------------.  
                                  V                 |  
>>-+-----------------+--+-GBLA-+----variable_symbol-+----------><
   '-sequence_symbol-'  +-GBLB-+                       
                        '-GBLC-'                       
 
sequence_symbol
is a sequence symbol.
variable_symbol
is a variable symbol, with or without the leading ampersand (&).

These instructions can be used anywhere in the body of a macro definition or in the open code portion of a source module.

Any variable symbols declared in the operand field have a global scope. They can be used as SET symbols anywhere after the pertinent GBLA, GBLB, or GBLC instructions. However, they can be used only within those parts of a program in which they have been declared as global SET symbols; that is, in any macro definition and in open code.

The assembler assigns an initial value to the SET symbol only when it processes the first GBLA, GBLB, or GBLC instruction in which the symbol appears. Later GBLA, GBLB, or GBLC instructions do not reassign an initial value to the SET symbol.

Multiple GBLx statements can declare the same variable symbol so long as only one declaration for a given symbol is encountered during the expansion of a macro.

The following rules apply to the global SET variable symbol:

Subscripted global SET symbols

A global subscripted SET symbol is declared by the GBLA, GBLB, or GBLC instruction.

Read syntax diagramSkip visual syntax diagram>>-+-----------------+--+-GBLA-+-------------------------------->
   '-sequence_symbol-'  +-GBLB-+  
                        '-GBLC-'  
 
   .-,--------------------------.  
   V                            |  
>----variable_symbol(dimension)-+------------------------------><
 
sequence_symbol
is a sequence symbol.
variable_symbol
is a variable symbol, with or without the leading ampersand (&).
dimension
is the dimension of the array. It must be an unsigned, decimal, self-defining term greater than zero.

Example:

         GBLA            &GA(25),&GA1(15)

There is no limit on the maximum subscript allowed, except that each subscripted variable is allocated storage, so the maximum subscript may be limited by the amount of storage available. Also, the limit specified in the global declaration (GBLx) can be exceeded. The dimension shows the number of SET variables associated with the subscripted SET symbol. The assembler assigns an initial value to every variable in the array thus declared.

Notes:
  1. Global arrays are assigned initial values only by the first global declaration processed, in which a global subscripted SET symbol appears.
  2. A subscripted global SET symbol can be used only if the declaration has a subscript, which represents a dimension; an unsubscripted global SET symbol can be used only if the declaration had no subscript, except for a number attribute reference to the name of a dimensioned SET symbol.

Alternative format for GBLx statements

The assembler permits the alternative statement format for GBLx instructions:

                                                               Cont.

         GBLA            &GLOBAL_SYMBOL_FOR_DC_GEN,              X
                         &LOOP_CONTRL_A,                         X
                         &VALUE_PASSED_TO_FIDO,                  X
                         &VALUE_RETURNED_FROM_FIDO

[ Top of Page | Previous Page | Next Page | Contents | Index ]