Assignment Statements

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:

There are two types of assignment statements:

Symbol Assignment Statements

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

Register Assignment Statements

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