HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

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

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

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

Saved successfully!

Ooh no, something went wrong!