The EQU instruction assigns absolute or relocatable values to symbols. Use it to:
EQU also assigns attributes. It takes the value, relocation, and length attributes of the operand and assigns them to the name field symbol, and sets the integer and scale attributes to zero. The type attributes of an absolute expression is always 'U', and its length attribute is always 1 (unless the second and third operands are specified.
When there is a symbol naming a complex relocatable expression, or a complex relocatable expression is eventually "reduced" to an absolute or simply relocatable expression, the first symbol is used for attribute assignment.
The program type is always null, and the assembler type is always null, except when the appropriate operand is specified.
Any symbols used in expression_1 need not be previously defined. However, if any symbol is not previously defined, the value of expression_1 is not assigned to the symbol in the name field until assembly time and therefore may not be used during conditional assembly (see Using conditional assembly values).
If expression_1 is a complexly relocatable expression, the whole expression, rather than its value, is assigned to the symbol. During the evaluation of any expression that includes a complexly relocatable symbol, that symbol is replaced by its own defining expression. Consider the following example, in which A1 and A2 are defined in one control section, and B1 and B2 in another:
X EQU A1+B1 Y EQU X-A2-B2
The first EQU statement assigns a complexly relocatable expression (A1+B1) to X. During the evaluation of the expression in the second EQU statement, X is replaced by its defining relocatable expression (A1+B1), and the assembler evaluates the resulting expression (A1+B1-A2-B2) and assigns an absolute value to Y, because the relocatable terms in the expression are paired. Note that the expression may not contain literals.
A DS CL121 Define a print line buffer ACC Equ A,1 Define first character, length 1The symbol ACC has the same location value as A, but length attribute 1.
All symbols appearing in expression_2 must have been previously defined, and all expressions in expression_2 must be evaluatable when the EQU statement is processed. For example, the second operand in the statements defining the symbol X cannot be evaluated when the last statement has been processed, because the value of the symbol X is unknown until the symbol A has been defined.
Z DS XL(L'A) Z DS XL(A) Y DS XL7 Y DS XL7 X EQU Z,*-Z X EQU Z,*-Z A DS XL5 A EQU 5
If expression_2 is omitted, the assembler assigns a length attribute value to the symbol in the name field according to the length attribute value of the leftmost (or only) term of expression_1, as follows:
For more information about the length attribute value, see Symbol length attribute reference.
For example:
X DS CL80 X has length attribute 80 Y EQU X,40 Y has length attribute 40
All symbols appearing in expression_3 must have been previously defined, and all expressions in expression_3 must be evaluatable when the EQU statement is processed.
If expression_3 is omitted, the assembler assigns a type attribute value of U to the symbol, which means the symbol in the name field has an undefined (or unknown or unassigned) type attribute. See the general discussion about data attributes on page Data attributes, and Type attribute (T').
For example:
A DS D A has type attribute D B EQU A,,C'X' B has type attribute X
All symbols appearing in expression_4 must have been previously defined, and all expressions in expression_4 must be evaluatable when the EQU statement is processed.
If expression_4 is omitted, the assembler assigns a null to the program type, and querying the value using the SYSATTRP built-in function returns a null value.
Valid values for this operand are:
AR Register - Access CR Register - Control CR32 Register - Control 32-bit CR64 Register - Control 64-bit FPR Register - Floating-Point GR Register - General GR32 Register - General 32-bit GR64 Register - General 64-bit
If expression_5 is omitted, the assembler assigns a null value to the assembler type, and querying the value using the SYSATTRA built-in function returns a null value.
The EQU instruction can be used anywhere in a source module after the ICTL instruction. Note, however, that the EQU instruction will initiate an unnamed control section (private code) if it is specified before the first control section.
[ Top of Page | Previous Page | Next Page | Contents | Index ]