Equate statements enable the programmer to define a symbol by assigning it a value. This value may be a reference to another symbol, register name, or expression. In equate statements, a symbol can be defined only once throughout the source file. These symbols may have forward references, except when referencing a register name. A symbol name defined in an equate statement cannot be defined in an assignment statement.
Equate statements have the same syntax as assignment statements, except for the operator.
There are two types of equate statements:
symbol equate statements
register equate statements
A symbol equate 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 can contain forward references. |
The following is an example of an equate statement that defines a symbol:
A == 5
A register equate 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. The register name cannot contain forward references. If the register name is a stack or rotating register name, the new register name continues to refer to the previously-defined register, 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 equate statement that defines a register name:
A == r1