HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Data Attributes Assembler gives a type attribute that shows the type of data specified in the literal. The COMPAT(LITTYPE) option causes High Level Assembler to behave like Assembler H, always giving a type attribute of U for the T' literal. Length Attribute (L') The length attribute has a numeric value equal to the number of bytes occupied by the data that is named by the symbol specified in the attribute reference. If the length attribute value is desired for conditional assembly processing, the symbol specified in the attribute reference must ultimately represent the name entry of a statement in open code. In such a statement, the length modifier (for DC and DS instructions) or the length field (for a machine instruction), if specified, must be a self-defining term, of a predefined absolute symbol. If multiple operands are specified in a DC or DS instruction, the attribute of the statement label is determined from the first operand. The length modifier or length field must not be coded as a multiterm expression, because the assembler does not evaluate this expression until assembly time. The assembler lets you use the length attribute with a SETC symbol, a system variable symbol, or a symbolic parameter, if the value of the SETC symbol is an ordinary symbol that can be referenced by the length attribute. The length attribute can also be specified outside conditional assembly instructions. Then, the length attribute value is not available for conditional assembly processing, but is used as a value at assembly time. Figure 92 is an example showing the evaluation of the length attribute for an assembler instruction in statement 1 and for a conditional assembly instruction in statement 8. E74 1 CSYM DC CL(L'ZLOOKAHEAD)'X' Length resolved later 2 &LEN SETA L'CSYM ASMA42E Length attribute of symbol is unavailable; default=1 3 DC C'&LEN ' REAL LENGTH NOT AVAILABLE 2 F14 + DC C'1 ' REAL LENGTH NOT AVAILABLE 4 &TYP SETC T'CSYM 5 DC C'&TYP ' TYPE IS KNOWN 4 C34 + DC C'C ' TYPE IS KNOWN 6 &DEF SETA D'CSYM 7 DC C'&DEF ' SYMBOL IS DEFINED 6 F14 + DC C'1 ' SYMBOL IS DEFINED 8 &LEN SETA L'zlookahead Length resolved immediately 9 CSYM2 DC CL(&len)'X' 8 E74 +CSYM2 DC CL(2)'X' 1 &LEN SETA L'CSYM2 11 DC C'&LEN ' REAL LENGTH NOW AVAILABLE A F24 + DC C'2 ' REAL LENGTH NOW AVAILABLE C 1 12 ZLOOKAHEAD DC H'1' 13 END Figure 92. Evaluation of Length Attribute References In statement 2 the length of CSYM has not been established because the definition of CSYM in statement 1 is not complete. The reference to the length attribute results in a length of 1 and error message ASMA042E. However, statement 5 shows that the 332 HLASM V1R5 Language Reference
Data Attributes type attribute is assigned, and statement 7 shows that the defined attribute is assigned. In comparison, the length attribute for symbol CSYM2 is available immediately, as it was retrieved indirectly using the conditional assembly instruction in statement 8. During conditional assembly, an ordinary symbol used in the name field of an EQU | instruction has a length attribute value that depends on the order of the symbol's | definition and the reference to its length attribute. | If the first operand of the EQU instruction is a self-defining term, the length | attribute value is 1. | If the first operand of the EQU instruction is a symbol whose value and length | attribute are defined, the length attribute value is that of the symbol in the first | operand. | If the first operand of the EQU instruction is a defined symbol and the EQU | instruction specifies a length value in the second operand, the length attribute | value is that of the second operand. | At assembly time, the symbol has the same length attribute value as the first term of the expression in the first operand of the EQU instruction. However, the second operand of an EQU instruction can be used to assign a length attribute value to the symbol in the name field. This second operand can not be a forward reference to another EQU instruction. Notes: 1. The length attribute reference, when used in conditional assembly processing, can be specified only in arithmetic expressions. 2. When used in conditional assembly processing, a length attribute reference to a symbol with the type attribute value of M, N, O, T, U, or $ is flagged. The length attribute for the symbol has the default value of 1. Scale Attribute (S') The scale attribute can be used only when referring to fixed-point, floating-point, or decimal constants. The following table shows the numeric value assigned to the scale attribute: Constant Types Allowed Type of DC or DS Allowed Value of Scale Attribute Assigned Fixed-Point H and F Equal to the value of the scale modifier (−187 through +346) Floating Point D, E, and L Equal to the value of the scale modifier (0 through 14 — D, E) (0 through 28 — L) Decimal P and Z Equal to the number of decimal digits specified to the right of the decimal point (0 through 31 — P) (0 through 16 — Z) Chapter 9. How to Write Conditional Assembly Instructions 333
- Page 302 and 303: &SYSNDX System Variable Symbol The
- Page 304 and 305: &SYSOPT_DBCS System Variable Symbol
- Page 306 and 307: &SYSPARM System Variable Symbol Not
- Page 308 and 309: &SYSPRINT_MEMBER System Variable Sy
- Page 310 and 311: &SYSPUNCH_MEMBER System Variable Sy
- Page 312 and 313: &SYSSTEP System Variable Symbol Not
- Page 314 and 315: &SYSTERM_DSN System Variable Symbol
- Page 316 and 317: &SYSTIME System Variable Symbol Not
- Page 318 and 319: Macro Instruction Format sequence_s
- Page 320 and 321: Macro Instruction Format Operand En
- Page 322 and 323: Macro Instruction Format When you n
- Page 324 and 325: Sublists in Operands the order in w
- Page 326 and 327: Sublists in Operands &SYSLIST( n,m)
- Page 328 and 329: Values in Operands Notes: 1. Spaces
- Page 330 and 331: Values in Operands Parentheses In m
- Page 332 and 333: Inner and Outer Macro Instructions
- Page 334 and 335: Levels of Macro Call Nesting When t
- Page 336 and 337: Levels of Macro Call Nesting System
- Page 338 and 339: How to Write Conditional Assembly I
- Page 340 and 341: SET Symbols SET Symbol Specificatio
- Page 342 and 343: SET Symbols Figure 86 (Page 3 of 3)
- Page 344 and 345: Data Attributes this example indica
- Page 346 and 347: Data Attributes variable_symbol is
- Page 348 and 349: Data Attributes The value of an att
- Page 350 and 351: Data Attributes The following attri
- Page 354 and 355: Data Attributes The scale attribute
- Page 356 and 357: Data Attributes Number Attribute (N
- Page 358 and 359: Data Attributes The operation code
- Page 360 and 361: Lookahead MACRO &NAME MOVE &TO,&FRO
- Page 362 and 363: Open Code Sequence Symbols The cond
- Page 364 and 365: GBLA, GBLB, and GBLC Instructions G
- Page 366 and 367: LCLA, LCLB, and LCLC Instructions s
- Page 368 and 369: SETA Instruction expression is an a
- Page 370 and 371: SETA Instruction | The logical-exp
- Page 372 and 373: SETA Instruction | Figure 99 (Page
- Page 374 and 375: SETA Instruction | The result of C2
- Page 376 and 377: SETA Instruction NOT Format: Logica
- Page 378 and 379: SETA Instruction | X2A Name Operati
- Page 380 and 381: SETA Instruction In evaluating the
- Page 382 and 383: SETB Instruction Any expression tha
- Page 384 and 385: SETB Instruction ┌─────
- Page 386 and 387: SETB Instruction | ISDEC | Format:
- Page 388 and 389: SETB Instruction The two comparands
- Page 390 and 391: SETC Instruction Notes: 1. The asse
- Page 392 and 393: Figure 103. Substring Notation in C
- Page 394 and 395: Loc Object Code Addr1 Addr2 Stmt So
- Page 396 and 397: | B2C('111111') has value '3' | B2C
- Page 398 and 399: | Output: D2B('decstring') converts
- Page 400 and 401: SIGNED Format: Logical-expression,
Data Attributes<br />
type attribute is assigned, and statement 7 shows that the defined attribute is<br />
assigned. In comparison, the length attribute for symbol CSYM2 is available<br />
immediately, as it was retrieved indirectly using the conditional assembly instruction<br />
in statement 8.<br />
During conditional assembly, an ordinary symbol used in the name field of an EQU<br />
| instruction has a length attribute value that depends on the order of the symbol's<br />
| definition and the reference to its length attribute.<br />
| If the first operand of the EQU instruction is a self-defining term, the length<br />
| attribute value is 1.<br />
| If the first operand of the EQU instruction is a symbol whose value and length<br />
| attribute are defined, the length attribute value is that of the symbol in the first<br />
| operand.<br />
| If the first operand of the EQU instruction is a defined symbol and the EQU<br />
| instruction specifies a length value in the second operand, the length attribute<br />
| value is that of the second operand.<br />
| At assembly time, the symbol has the same length attribute value as the first term<br />
of the expression in the first operand of the EQU instruction. However, the second<br />
operand of an EQU instruction can be used to assign a length attribute value to the<br />
symbol in the name field. This second operand can not be a forward reference to<br />
another EQU instruction.<br />
Notes:<br />
1. The length attribute reference, when used in conditional assembly processing,<br />
can be specified only in arithmetic expressions.<br />
2. When used in conditional assembly processing, a length attribute reference to a<br />
symbol with the type attribute value of M, N, O, T, U, or $ is flagged. The<br />
length attribute for the symbol has the default value of 1.<br />
Scale Attribute (S')<br />
The scale attribute can be used only when referring to fixed-point, floating-point, or<br />
decimal constants. The following table shows the numeric value assigned to the<br />
scale attribute:<br />
Constant<br />
Types<br />
Allowed<br />
Type of DC or DS<br />
Allowed<br />
Value of Scale<br />
Attribute Assigned<br />
Fixed-Point H and F Equal to the value of the scale modifier<br />
(−187 through +346)<br />
Floating Point D, E, and L Equal to the value of the scale modifier<br />
(0 through 14 — D, E)<br />
(0 through 28 — L)<br />
Decimal P and Z Equal to the number of decimal digits<br />
specified to the right of the decimal<br />
point<br />
(0 through 31 — P)<br />
(0 through 16 — Z)<br />
Chapter 9. How to Write Conditional Assembly Instructions 333