Assignment statements enable the programmer to define or redefine a symbol by assigning it a value. This value may be a reference to another symbol, register name, or expression. The new value takes effect immediately and remains in effect until the symbol is redefined. Symbols defined in assignment statements do not have forward references.
In addition, symbols defined in assignment statements cannot:
appear in the symbol table of an output object file.
be declared global.
be defined in an equate statement.
There are two types of assignment statements:
Symbol assignment statements, which define or redefine a symbol in the symbol name space.
Register assignment statements, which define or redefine a register name in the symbol name space.
A symbol assignment statement has the following syntax:
identifier=expression // comments
Where:
identifier |
Represents a symbol in the symbol name space. |
expression |
Specifies the type and value of the identifier. The expression cannot contain forward references. |
The following is an example of an assignment statement that defines a symbol:
C = L0+2
A register assignment statement has the following syntax:
identifier=register name // comments
Where:
identifier |
Represents a register name in the symbol name space. |
register name |
Specifies an alternate register name. If the register name is a stack or rotating register name, the new register name continues to reference the previously-defined register name, even if the name is no longer in effect. See the Register Stack Directive and Rotating Register Directives sections. |
The following is an example of an assignment statement that defines a register name:
A = r1