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

Terms, Literals, and Expressions 1. A literal with a relocatable address: L 3,=F'33' Register 3 set to 33. See note 1 L 3,F33 Register 3 set to 33. See note 2 . . . F33 DC F'33' 2. A literal with a self-defining term and a symbol with an absolute value MVC FLAG,=X'' FLAG set to X''. See note 1 MVI FLAG,X'' FLAG set to X''. See note 3 MVI FLAG,ZERO FLAG set to X''. See note 4 . . . FLAG DS X ZERO EQU X'' 3. A symbol having an absolute address value specified by a self-defining term LA 4,LOCORE Register 4 set to 1. See note 4 LA 4,1 Register 4 set to 1. See note 3 . . . LOCORE EQU 1 Notes: 1. A literal both defines data and represents data. The address of the literal is assembled into the object code of the instruction in which it is used. The constant specified by the literal is assembled into the object code, in the literal pool. 2. A constant is represented by a symbol with a relocatable value. The address of a constant is assembled into the object code. 3. A self-defining term has an absolute value. In this example, the absolute value of the self-defining term is assembled into the object code. 4. A symbol with an absolute value does not represent the address of a constant, but represents either immediate data or an absolute address. When a symbol with an absolute value represents immediate data, it is the absolute value that is assembled into the object code. Figure 15. Differences between Literals, Constants, and Self-Defining Terms General Rules for Using Literals You can specify a literal as either a complete operand in a machine instruction, or as part of an expression in the operand of a machine instruction. A literal can also be specified as the name field on a macro call instruction. Because literals define read-only data, they must not be used in operands that represent the receiving field of an instruction that modifies storage. The assembler requires a description of the type of literal being specified as well as the literal itself. This descriptive information assists the assembler in assembling the literal correctly. The descriptive portion of the literal must indicate the format of the constant. It can also specify the length of the constant. 42 HLASM V1R5 Language Reference

Terms, Literals, and Expressions The method of describing and specifying a constant as a literal is nearly identical to the method of specifying it in a single operand of a DC assembler instruction. The only difference is that the literal must start with an equal sign (=), which indicates to | the assembler that a literal follows. The length of the literal, including the equal | sign, constant type and modifiers, delimiters, and nominal values is limited to a | maximum of 256 characters. A literal may be coded as indicated here: =1XL5'F3' where the subfields are: Duplication factor 1 Type X Modifiers L5 Nominal value 'F3' The following instruction shows one use of a literal: GAMMA L 1,=F'274' The statement GAMMA is a load instruction using a literal as the second operand. When assembled, the second operand of the instruction refers to the relative address at which the value F'274' is stored. | You cannot rely on the ordering of literals in the literal pool remaining the same. | For this reason, referring to a point that extends beyond the bounds of a literal is | flagged with warning message ASMA015W. Here is an example of such a | reference: | BETA L 1,=F'274'+4 In general, literals can be used wherever a storage address is permitted as an operand, including in conjunction with an index register in instructions with the RX format. For example: DELTA LH 5,=H'11,23,39,48,64'(6) is equivalent to: DELTA LH 5,LENGTHS(6) . . . LENGTHS DC H'11,23,39,48,64' See “DC Instruction” on page 126 for a description of how to specify the subfields in a literal. Literals cannot be used in any assembler instruction where a previously defined | symbol is required, but length attribute references to previously defined literals are | allowed. Literals are relocatable terms because the address of the literal, rather than the literal-generated constant itself, is assembled in the statement that references a literal. The assembler generates the literals, collects them, and places them in a specific area of storage, as explained under “Literal Pool” on page 44. Because the assembler determines the order in which literals are placed in the literal pool, the effect of using two literals as paired relocatable terms (see “Paired Relocatable Terms” on page 47) is unpredictable. Chapter 2. Coding and Structure 43

Terms, Literals, and Expressions<br />

The method of describing and specifying a constant as a literal is nearly identical to<br />

the method of specifying it in a single operand of a DC assembler instruction. The<br />

only difference is that the literal must start with an equal sign (=), which indicates to<br />

| the assembler that a literal follows. The length of the literal, including the equal<br />

| sign, constant type and modifiers, delimiters, and nominal values is limited to a<br />

| maximum of 256 characters.<br />

A literal may be coded as indicated here:<br />

=1XL5'F3'<br />

where the subfields are:<br />

Duplication factor 1<br />

Type<br />

X<br />

Modifiers<br />

L5<br />

Nominal value 'F3'<br />

The following instruction shows one use of a literal:<br />

GAMMA L 1,=F'274'<br />

The statement GAMMA is a load instruction using a literal as the second operand.<br />

When assembled, the second operand of the instruction refers to the relative<br />

address at which the value F'274' is stored.<br />

| You cannot rely on the ordering of literals in the literal pool remaining the same.<br />

| For this reason, referring to a point that extends beyond the bounds of a literal is<br />

| flagged with warning message ASMA015W. Here is an example of such a<br />

| reference:<br />

| BETA L 1,=F'274'+4<br />

In general, literals can be used wherever a storage address is permitted as an<br />

operand, including in conjunction with an index register in instructions with the RX<br />

format. For example:<br />

DELTA LH 5,=H'11,23,39,48,64'(6)<br />

is equivalent to:<br />

DELTA LH 5,LENGTHS(6)<br />

.<br />

.<br />

.<br />

LENGTHS DC<br />

H'11,23,39,48,64'<br />

See “DC Instruction” on page 126 for a description of how to specify the subfields<br />

in a literal.<br />

Literals cannot be used in any assembler instruction where a previously defined<br />

| symbol is required, but length attribute references to previously defined literals are<br />

| allowed. Literals are relocatable terms because the address of the literal, rather<br />

than the literal-generated constant itself, is assembled in the statement that<br />

references a literal. The assembler generates the literals, collects them, and places<br />

them in a specific area of storage, as explained under “Literal Pool” on page 44.<br />

Because the assembler determines the order in which literals are placed in the<br />

literal pool, the effect of using two literals as paired relocatable terms (see “Paired<br />

Relocatable Terms” on page 47) is unpredictable.<br />

Chapter 2. Coding and Structure 43

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

Saved successfully!

Ooh no, something went wrong!