Constructing symbols
The Symbols consist of numeric digits, underscores, periods, or lowercase letters.
Symbols may consist of numeric digits, underscores, periods, uppercase or lowercase letters, or any combination of these. The symbol cannot contain any blanks or special characters, and cannot begin with a digit. Uppercase and lowercase letters are distinct. The maximum length of a symbol name is 65535 single-byte characters.
If a symbol must contain blanks or other special characters, the .rename pseudo-op allows a local name to be used as a synonym or alias for the global name.
With the exception of control section (csect) or Table of Contents (TOC) entry names, symbols might be used to represent storage locations or arbitrary data. The value of a symbol is always a 32-bit quantity when assembling the symbol in 32-bit mode, and the value is always a 64-bit quantity when assembling the symbol in 64-bit mode.
The following are valid examples of symbol names:
- READER
- XC2345
- result.a
- resultA
- balance_old
- _label9
- .myspot
The following are not valid symbol names:
| Item | Description |
|---|---|
| 7_sum | (Begins with a digit.) |
| #ofcredits | (The # makes this a comment.) |
| aa*1 | (Contains *, a special character.) |
| IN AREA | (Contains a blank.) |
You can define a symbol by using it in one of two ways:
- As a label for an instruction or pseudo-op
- As the name operand of a .set, .comm, .lcomm, .dsect, .csect, or .rename pseudo-op.