HLASM Language Reference
HLASM Language Reference HLASM Language Reference
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
- Page 12 and 13: About this Manual This manual descr
- Page 14 and 15: IBM High Level Assembler for MVS &
- Page 16 and 17: | The Internet. You can access IBM
- Page 18 and 19: ▌C▐ The item referred to by ▌
- Page 20 and 21: Miscellany The ASCII translation t
- Page 22 and 23: Part 1. Assembler Language—Struct
- Page 24 and 25: Language Compatibility Language Com
- Page 26 and 27: Assembler Program Assembler Program
- Page 28 and 29: Relationship of Assembler to Operat
- Page 30 and 31: Coding Made Easier Linkage between
- Page 32 and 33: Character Set Compatibility with Ea
- Page 34 and 35: Assembler Language Coding Conventio
- Page 36 and 37: Assembler Language Coding Conventio
- Page 38 and 39: Assembler Language Coding Conventio
- Page 40 and 41: Assembler Language Coding Conventio
- Page 42 and 43: Assembler Language Structure Condit
- Page 44 and 45: Assembler Language Structure Machin
- Page 46 and 47: Assembler Language Structure Condit
- Page 48 and 49: Terms, Literals, and Expressions Te
- Page 50 and 51: Terms, Literals, and Expressions -
- Page 52 and 53: Terms, Literals, and Expressions As
- Page 54 and 55: Terms, Literals, and Expressions Se
- Page 56 and 57: Terms, Literals, and Expressions Fo
- Page 58 and 59: Terms, Literals, and Expressions I
- Page 60 and 61: Terms, Literals, and Expressions Th
- Page 64 and 65: Terms, Literals, and Expressions
- Page 66 and 67: Terms, Literals, and Expressions
- Page 68 and 69: Terms, Literals, and Expressions Th
- Page 70 and 71: | Chapter 3. Program Structures and
- Page 72 and 73: Source Module A source module is co
- Page 74 and 75: The CSECT instruction can be used a
- Page 76 and 77: | in linker control statements for
- Page 78 and 79: This is not only convenient, but it
- Page 80 and 81: | SECT_A CSECT , Define section SEC
- Page 82 and 83: | For executable sections, the loca
- Page 84 and 85: Addressing | The System/390® and z
- Page 86 and 87: Addressing | Parts must always be r
- Page 88 and 89: Addressing Literal Pools ALPHA LR 3
- Page 90 and 91: Addressing If the symbol is the nam
- Page 92 and 93: Addressing External Symbol Dictiona
- Page 94 and 95: Addressing 74 HLASM V1R5 Language R
- Page 96 and 97: Part 2. Machine and Assembler Instr
- Page 98 and 99: General Instructions Chapter 4. Mac
- Page 100 and 101: Input/Output Operations For further
- Page 102 and 103: Branching with Extended Mnemonic Co
- Page 104 and 105: Symbolic Operation Codes variations
- Page 106 and 107: Operand Entries Registers You can s
- Page 108 and 109: Operand Entries “Program Structur
- Page 110 and 111: Operand Entries Format │ Coded or
Terms, Literals, and Expressions<br />
1. A literal with a relocatable address:<br />
L 3,=F'33' Register 3 set to 33. See note 1<br />
L 3,F33 Register 3 set to 33. See note 2<br />
.<br />
.<br />
.<br />
F33 DC F'33'<br />
2. A literal with a self-defining term and a symbol with an absolute value<br />
MVC FLAG,=X'' FLAG set to X''. See note 1<br />
MVI FLAG,X'' FLAG set to X''. See note 3<br />
MVI FLAG,ZERO FLAG set to X''. See note 4<br />
.<br />
.<br />
.<br />
FLAG DS X<br />
ZERO EQU X''<br />
3. A symbol having an absolute address value specified by a self-defining term<br />
LA 4,LOCORE Register 4 set to 1. See note 4<br />
LA 4,1 Register 4 set to 1. See note 3<br />
.<br />
.<br />
.<br />
LOCORE EQU 1<br />
Notes:<br />
1. A literal both defines data and represents data. The address of the literal is assembled<br />
into the object code of the instruction in which it is used. The constant specified by the<br />
literal is assembled into the object code, in the literal pool.<br />
2. A constant is represented by a symbol with a relocatable value. The address of a<br />
constant is assembled into the object code.<br />
3. A self-defining term has an absolute value. In this example, the absolute value of the<br />
self-defining term is assembled into the object code.<br />
4. A symbol with an absolute value does not represent the address of a constant, but<br />
represents either immediate data or an absolute address. When a symbol with an<br />
absolute value represents immediate data, it is the absolute value that is assembled into<br />
the object code.<br />
Figure 15. Differences between Literals, Constants, and Self-Defining Terms<br />
General Rules for Using Literals<br />
You can specify a literal as either a complete operand in a machine instruction, or<br />
as part of an expression in the operand of a machine instruction. A literal can also<br />
be specified as the name field on a macro call instruction.<br />
Because literals define read-only data, they must not be used in operands that<br />
represent the receiving field of an instruction that modifies storage.<br />
The assembler requires a description of the type of literal being specified as well as<br />
the literal itself. This descriptive information assists the assembler in assembling<br />
the literal correctly. The descriptive portion of the literal must indicate the format of<br />
the constant. It can also specify the length of the constant.<br />
42 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>