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 The following attribute is used for the type attribute of the value of variable symbols: N The value is numeric The following letter is used for symbols or macro instruction operands that cannot be assigned any of the above letters: U Undefined, unknown, or unassigned The common use of the U type attribute is to describe a valid symbol that has not been assigned any of the type attribute values described above. If the assembler is not able to determine what the named symbol represents, it also assigns the U type attribute. Thus, the U type attribute can mean undefined, or unknown, or unassigned at the time of the reference. Consider the following macro definition: Name Operation Operand macro MAC1 &op1,&op2 &A setc T'&op1 &B setc T'&op2 DC C'&A' DC containing type attribute for op1 DC C'&B' DC containing type attribute for op2 mend When the macro MAC1 is called in Figure 90, neither of the operands has previously been defined, however GOOD_SYMBOL is a valid symbol name, whereas ?BAD_SYMBOL? is not a valid symbol name. The type attribute for both operands is U, meaning GOOD_SYMBOL is undefined, and ?BAD_SYMBOL? is unknown. 4 8 a csect 9 mac1 GOOD_SYMBOL,?BAD_SYMBOL? E4 1+ DC C'U' DC containing type attribute for op1 1 E4 11+ DC C'U' DC containing type attribute for op2 12 end Figure 90. Undefined and Unknown Type Attributes When the macro MAC1 is called in Figure 91, GOOD_SYMBOL is a valid symbol name, and has been defined in the DC instruction at statement 12. ?BAD_SYMBOL? is a not valid symbol name, and the assembler issues an error message at statement 13. The type attribute for GOOD_SYMBOL is C, meaning the symbol represents a character constant. The type attribute for ?BAD_SYMBOL? is U, meaning the type is unknown. 6 8 a csect 9 mac1 GOOD_SYMBOL,?BAD_SYMBOL? C3 1+ DC C'C' DC containing type attribute for op1 1 E4 11+ DC C'U' DC containing type attribute for op2 2 A9 12 GOOD_SYMBOL dc cl1'z' 3 A9 13 ?BAD_SYMBOL? dc cl1'z' ASMA147E Symbol too long, or first character not a letter - ?BAD_SYMBOL? 14 end Figure 91. Unknown Type Attribute for Invalid Symbol The type attribute value U, meaning undefined, unknown, or unassigned, is assigned to the following: Ordinary symbols used as labels: 330 HLASM V1R5 Language Reference

Data Attributes – For the LTORG instruction – For the EQU instruction without a third operand – For DC and DS statements that contain variable symbols, for example, U1 DC &X'1' | – That are defined more than once, even though only one instance of the | label is generated due to conditional assembly statements. A | lookahead scan for attributes of a symbol may encounter more than one | occurrence of a symbol, in which case the assembler can't yet tell which | statement(s) will be generated. In such cases, type attribute U is | assigned. At a later time, when the symbol has been generated, its type | attribute is changed to the correct value for the type of statement it | names. Notes: SETC variable symbols that have a value other than a null character string or the name of an instruction that can be referred to be a type attribute reference System variable symbols except: – &SYSDATC, &SYSM_HSEV, &SYSM_SEV, &SYSNDX, &SYSNEST, &SYSOPT_DBCS, &SYSOPT_RENT, &SYSOPT_XOBJECT, and &SYSSTMT, which always have a type attribute value of N – Some other character type system variable symbols which may be assigned a value of a null string, when they have a type attribute value of O Macro instruction operands that specify a literal that is not a duplicate of a literal used in a machine instruction Inner macro instruction operands that are ordinary symbols 1. Ordinary symbols used in the name field of an EQU instruction have the type attribute value U. However, the third operand of an EQU instruction can be used explicitly to assign a type attribute value to the symbol in the name field. 2. The type attribute of a sublist is set to the same value as the type attribute of the first element of the sublist. 3. High Level Assembler and earlier assemblers treat the type attribute differently: Because High Level Assembler allows attribute references to statements generated through substitution, certain cases in which a type attribute of U (undefined, unknown, or unassigned) or M (macro name field) is given under the DOS/VSE Assembler, may give a valid type attribute under High Level Assembler. If the value of the SETC symbol is equal to the name of an instruction that can be referred to by the type attribute, High Level Assembler lets you use the type attribute with a SETC symbol. Because High Level Assembler allows attribute references to literals, certain cases in which a type attribute of U (undefined, unknown, or unassigned) is given by Assembler F and Assembler H for a macro operand that specifies a literal, may give a valid type attribute under High Level Assembler. If the literal specified in the macro instruction operand is a duplicate of a literal specified in open code, or previously generated by conditional assembly processing or macro generation, High Level Chapter 9. How to Write Conditional Assembly Instructions 331

Data Attributes<br />

The following attribute is used for the type attribute of the value of variable<br />

symbols:<br />

N<br />

The value is numeric<br />

The following letter is used for symbols or macro instruction operands that cannot<br />

be assigned any of the above letters:<br />

U<br />

Undefined, unknown, or unassigned<br />

The common use of the U type attribute is to describe a valid symbol that has<br />

not been assigned any of the type attribute values described above. If the<br />

assembler is not able to determine what the named symbol represents, it also<br />

assigns the U type attribute. Thus, the U type attribute can mean undefined, or<br />

unknown, or unassigned at the time of the reference. Consider the following<br />

macro definition:<br />

Name Operation Operand<br />

macro<br />

MAC1 &op1,&op2<br />

&A setc T'&op1<br />

&B setc T'&op2<br />

DC C'&A'<br />

DC containing type attribute for op1<br />

DC C'&B'<br />

DC containing type attribute for op2<br />

mend<br />

When the macro MAC1 is called in Figure 90, neither of the operands has<br />

previously been defined, however GOOD_SYMBOL is a valid symbol name, whereas<br />

?BAD_SYMBOL? is not a valid symbol name. The type attribute for both operands<br />

is U, meaning GOOD_SYMBOL is undefined, and ?BAD_SYMBOL? is unknown.<br />

4 8 a csect<br />

9 mac1 GOOD_SYMBOL,?BAD_SYMBOL?<br />

E4 1+ DC C'U' DC containing type attribute for op1<br />

1 E4 11+ DC C'U' DC containing type attribute for op2<br />

12 end<br />

Figure 90. Undefined and Unknown Type Attributes<br />

When the macro MAC1 is called in Figure 91, GOOD_SYMBOL is a valid symbol<br />

name, and has been defined in the DC instruction at statement 12.<br />

?BAD_SYMBOL? is a not valid symbol name, and the assembler issues an error<br />

message at statement 13. The type attribute for GOOD_SYMBOL is C, meaning the<br />

symbol represents a character constant. The type attribute for ?BAD_SYMBOL? is<br />

U, meaning the type is unknown.<br />

6 8 a csect<br />

9 mac1 GOOD_SYMBOL,?BAD_SYMBOL?<br />

C3 1+ DC C'C' DC containing type attribute for op1<br />

1 E4 11+ DC C'U' DC containing type attribute for op2<br />

2 A9 12 GOOD_SYMBOL dc cl1'z'<br />

3 A9<br />

13 ?BAD_SYMBOL? dc cl1'z'<br />

ASMA147E Symbol too long, or first character not a letter - ?BAD_SYMBOL?<br />

14 end<br />

Figure 91. Unknown Type Attribute for Invalid Symbol<br />

The type attribute value U, meaning undefined, unknown, or unassigned, is<br />

assigned to the following:<br />

Ordinary symbols used as labels:<br />

330 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!