Previously defined symbols
An ordinary symbol is previously defined if the statement that defines it is processed before the statement in which the symbol appears in an operand.
An ordinary symbol must be defined by the time the END statement
is reached, however, it need not be previously defined when it is
used as follows:
- In operand expressions of certain instructions such as CNOP instructions and some ORG instructions
- In modifier expressions of DC, DS, and DXD instructions
- In the first operand of an EQU instruction
- In Q-type constants
When using the forward-reference capability of the assembler, avoid
the following types of errors:
- Circular definition of symbols, such as:
X EQU Y Y EQU X
- Circular location-counter dependency, as in this example:
A DS (B-A)C B LR 1,2
The first statement in this example cannot be resolved because the value of the duplication factor is dependent on the location of
B
, which is, in turn, dependent upon the length and duplication factor ofA
.
Literals can contain symbolic expressions in modifiers, but any ordinary symbols used must have been previously defined.