Labels
ANSI
Labels are program execution points and are subject to the following conditions:
Labels must use the following naming conventions:
Valid alphabetic characters ( {a-z} or {A-Z}, case insensitive)
0 through 9
$ (dollar sign)
_ (underscore)
Labels must begin with # if it is a local label within an inclusion file.
Labels must begin with an alpha character, dollar sign ($), or an underscore unless it is a local label in an inclusion file.
Labels must be unique (only local labels may be used more than once).
Labels must begin in the first column of a source line.
Labels may be any size in length with the maximum default length being thirty-two characters.
Labels in excess of the defined label
size (default is thirty-two (32) characters) are reduced to the first n-1 and the last character.
The following are examples of valid LABELs:
|
A |
|
|
A1 |
|
|
A1$_ABC |
|
|
$01 |
|
|
$01$ |
|
|
$_ |
|
|
FOUR |
|
|
AMTSOLD |
|
|
#FIVE |
(local label used only within an inclusion) |
The following are examples of invalid labels:
|
6TEEN |
(does not begin with alpha character, #, $, or underscore) |
|
AMT-SOLD |
(contains an invalid character) |
Labels beginning with a pound sign (#) are treated as local to the inclusion. This allows use of labels of the same name in multiple inclusions or of an inclusion containing local label definitions used more than once in a program. Local labels are limited to n-3 characters (where 'n' is your selected label size) including the #.
Labels declared in the scope of a FUNCTION are uniquely identified to prevent conflict with any other label references in a program. Therefore, FUNCTION labels are limited to n-3 characters (where 'n' is your selected label size).
See Also: Instruction Syntax
![]() |