HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Terms, Literals, and Expressions Assembler Language │ Address Value │ Object Code Statements │ of Symbol │ in Hexadecimal ─────────────────────────┼─────────────────┼────────────────────────────────── │ Relocatable │ ┌────── Address │ │ ▼ of AREA │ │ ┌──┬─┬─┬────┐ LOAD L 3,AREA ▌1▐ LOAD ──────────┼────►│58│3││xxxx│ │ │ └──┴─┴─┴────┘ │ │ │ │ ┌───────────┐ AREA DS F ▌2▐ AREA ──────────┼────►│xx x x xxxx│ │ ┌──────┼────►└───────────┘ │ │ │ │ │ │ ┌───────────┐ F2 DC F'2' ▌3▐ F2 ──────────┼────►│ C8│ │ │ ┌──┼────►└───────────┘ ─────────────────────────┼──────────┼───┼──┼─────────────────────────────────── FULL EQU AREA │ FULL ───┘ │ │ ▌4▐ │ │ TW EQU F2 │ TW ───────┘ │ ─────────────────────────┼─────────────────┼─────────────────────────────────── │ Absolute │ │ │ R3 EQU 3 ▌5▐ R3=3 │ ┌────── Address │ │ ▼ of FULL │ │ ┌──┬─┬─┬────┐ L R3,FULL │ │ │58│3││xxxx│ │ │ ├──┼─┼─┼────┤ A R3,TW │ │ │5A│3││xxxx│ │ │ └──┴─┴─┴────┘ │ │ ▲ Address │ │ └────── of TW Figure 13. Transition from Assembler Language Statement to Object Code Restrictions on Symbols: A symbol must be defined only once in a source module with one or more control sections, with the following exceptions: The symbol in the name field of a CSECT, RSECT, DSECT, or COM instruction can be the same as the name of previous CSECT, RSECT, DSECT, or COM instruction, respectively. It identifies the resumption of the control section specified by the name field. The symbol in the name field of a CATTR instruction can be the same as the name of a previous CATTR instruction. It identifies the resumption of the class specified by the name field. The symbol in the name field of a LOCTR instruction can be the same as the name of a previous START, CSECT, RSECT, DSECT, COM, or LOCTR instruction. It identifies the resumption of the location counter specified by the name field. The symbol in the name field of a labeled USING instruction can be the same as the name of a previous labeled USING instruction. It identifies the termination of the domain of the previous labeled USING instruction with the specified name. A symbol can be used as an operand of a V-type constant and as an ordinary | label, without duplication, because the operand of a V-type constant does not | define the symbol in the symbol table. 32 HLASM V1R5 Language Reference
Terms, Literals, and Expressions An ordinary symbol is not defined when: It is used in the name field of an OPSYN or TITLE instruction. It can, therefore, be used in the name field of any other statement in a source module. It is used as the operand of a V-type address constant. It is only used in the name field of a macro instruction and does not appear in the name field of a macro-generated assembler statement. It can, therefore, be used in the name field of any other statement in a source module. It is only used in the name field of an ALIAS instruction and does not appear in one of the following: – The name field of a START, CSECT, RSECT, COM, or DXD instruction. – The name field of a DSECT instruction and the nominal value of a Q-type address constant. – The operand of an ENTRY, EXTRN or WXTRN instruction. Previously Defined Symbols: An ordinary symbol is previously defined if the statement that defines it is processed before the statement in which the symbol | appears in an operand. An ordinary symbol must be defined by the time the END statement is reached, however, it need not be previously defined when it is used as follows: In operand expressions of certain instructions such as CNOP instructions and some ORG instructions In modifier expressions of DC, DS, and DXD instructions In the first operand of an EQU instruction In Q-type constants When using the forward-reference capability of the assembler, avoid the following types of errors: Circular definition of symbols, such as: X EQU Y Y EQU X Circular location-counter dependency, as in this example: A DS (B-A)C B LR 1,2 The first statement in this example cannot be resolved because the value of the duplication factor is dependent on the location of B, which is, in turn, dependent upon the length and duplication factor of A. Literals may contain symbolic expressions in modifiers, but any ordinary symbols used must have been previously defined. Chapter 2. Coding and Structure 33
- Page 1: High Level Assembler for MVS & VM &
- Page 4 and 5: Note! Before using this information
- Page 6 and 7: Contents Source Module . . . . . .
- Page 8 and 9: Contents Ordinary USING Instruction
- Page 10 and 11: Contents Sublists in Operands . . .
- 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 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 62 and 63: Terms, Literals, and Expressions 1.
- 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
Terms, Literals, and Expressions<br />
Assembler <strong>Language</strong> │ Address Value │ Object Code<br />
Statements │ of Symbol │ in Hexadecimal<br />
─────────────────────────┼─────────────────┼──────────────────────────────────<br />
│ Relocatable │ ┌────── Address<br />
│ │ ▼ of AREA<br />
│ │ ┌──┬─┬─┬────┐<br />
LOAD L 3,AREA ▌1▐ LOAD ──────────┼────►│58│3││xxxx│<br />
│ │ └──┴─┴─┴────┘<br />
│<br />
│<br />
│ │ ┌───────────┐<br />
AREA DS F ▌2▐ AREA ──────────┼────►│xx x x xxxx│<br />
│<br />
┌──────┼────►└───────────┘<br />
│ │ │<br />
│ │ │ ┌───────────┐<br />
F2 DC F'2' ▌3▐ F2 ──────────┼────►│ C8│<br />
│ │ ┌──┼────►└───────────┘<br />
─────────────────────────┼──────────┼───┼──┼───────────────────────────────────<br />
FULL EQU AREA │ FULL ───┘ │ │<br />
▌4▐ │ │<br />
TW EQU F2 │ TW ───────┘ │<br />
─────────────────────────┼─────────────────┼───────────────────────────────────<br />
│ Absolute │<br />
│<br />
│<br />
R3 EQU 3 ▌5▐ R3=3 │ ┌────── Address<br />
│ │ ▼ of FULL<br />
│ │ ┌──┬─┬─┬────┐<br />
L R3,FULL │ │ │58│3││xxxx│<br />
│ │ ├──┼─┼─┼────┤<br />
A R3,TW │ │ │5A│3││xxxx│<br />
│ │ └──┴─┴─┴────┘<br />
│ │ ▲ Address<br />
│ │ └────── of TW<br />
Figure 13. Transition from Assembler <strong>Language</strong> Statement to Object Code<br />
Restrictions on Symbols: A symbol must be defined only once in a source<br />
module with one or more control sections, with the following exceptions:<br />
The symbol in the name field of a CSECT, RSECT, DSECT, or COM instruction<br />
can be the same as the name of previous CSECT, RSECT, DSECT, or COM<br />
instruction, respectively. It identifies the resumption of the control section<br />
specified by the name field.<br />
<br />
The symbol in the name field of a CATTR instruction can be the<br />
same as the name of a previous CATTR instruction. It identifies the resumption<br />
of the class specified by the name field.<br />
The symbol in the name field of a LOCTR instruction can be the same as the<br />
name of a previous START, CSECT, RSECT, DSECT, COM, or LOCTR<br />
instruction. It identifies the resumption of the location counter specified by the<br />
name field.<br />
The symbol in the name field of a labeled USING instruction can be the same<br />
as the name of a previous labeled USING instruction. It identifies the<br />
termination of the domain of the previous labeled USING instruction with the<br />
specified name.<br />
A symbol can be used as an operand of a V-type constant and as an ordinary<br />
| label, without duplication, because the operand of a V-type constant does not<br />
| define the symbol in the symbol table.<br />
32 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>