11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EQU instruction||||to the symbol in the name field until assembly time and therefore may not beused during conditional assembly (see “Using conditional assembly values” onpage 186).If expression_1 is a complexly relocatable expression, the whole expression,rather than its value, is assigned to the symbol. During the evaluation of anyexpression that includes a complexly relocatable symbol, that symbol isreplaced by its own defining expression. Consider the following example, inwhich A1 and A2 are defined in one control section, and B1 and B2 in another:X EQU A1+B1Y EQU X−A2−B2The first EQU statement assigns a complexly relocatable expression (A1+B1) toX. During the evaluation of the expression in the second EQU statement, X isreplaced by its defining relocatable expression (A1+B1), and the assemblerevaluates the resulting expression (A1+B1-A2-B2) and assigns an absolute valueto Y, because the relocatable terms in the expression are paired. Note that theexpression may not contain literals.expression_2represents a value that the assembler assigns as a length attribute value to thesymbol in the name field. It is optional, but, if specified, must be an absolutevalue in the range 0 to 65,535. This value overrides the normal length attributevalue implicitly assigned from expression_1. For example:A DS CL121 Define a print line bufferACC 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, andall expressions in expression_2 must be evaluatable when the EQU statement isprocessed. For example, the second operand in the statements defining thesymbol 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 beendefined.Z DS XL(L’A) Z DS XL(A)Y DS XL7 Y DS XL7X EQU Z,*-Z X EQU Z,*-ZA DS XL5 A EQU 5If expression_2 is omitted, the assembler assigns a length attribute value to thesymbol in the name field according to the length attribute value of the leftmost(or only) term of expression_1, as follows:1. If the leftmost term of expression_1 is a location counter reference (*), aself-defining term, or a symbol length attribute value reference, the lengthattribute is 1. This also applies if the leftmost term is a symbol that isequated to any of these values.2. If the leftmost term of expression_1 is a symbol that is used in the namefield of a DC or DS instruction, the length attribute value is equal to theimplicit or explicit length of the first (or only) constant specified in the DCor DS operand field.3. If the leftmost term is a symbol that is used in the name field of a machineinstruction, the length attribute value is equal to the length of theassembled instruction.184 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!