HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Terms, Literals, and Expressions Terms, Literals, and Expressions The most basic element of the assembler language is the term. Terms may be used alone, or in combination with other terms in expressions. This section describes the different types of terms used in the assembler language, and how they can be used. Terms A term is the smallest element of the assembler language that represents a distinct and separate value. It can, therefore, be used alone or in combination with other terms to form expressions. Terms are classified as absolute or relocatable, depending on the effect of program relocation upon them. Program relocation is the loading of the object program into storage locations other than those originally assigned by the assembler. Terms have absolute or relocatable values that are assigned by the assembler or that are inherent in the terms themselves. A term is absolute if its value does not change upon program relocation. A term is relocatable if its value changes by n if the origin of the control section in which it appears is relocated by n bytes. Terms in Parentheses: Terms in parentheses are reduced to a single value; thus the terms in parentheses, in effect, become a single term. You can use arithmetically combined terms, enclosed in parentheses, in combination with terms outside the parentheses, as follows: 14+BETA-(GAMMA-LAMBDA) When the assembler encounters terms in parentheses in combination with other terms, it first reduces the combination of terms inside the parentheses to a single value which may be absolute or relocatable, depending on the combination of terms. This value is then used in reducing the rest of the combination to another single value. You can include terms in parentheses within a set of terms in parentheses: A+B-(C+D-(E+F)+1) The innermost set of terms in parentheses is evaluated first. Any number of levels of parentheses are allowed. A level of parentheses is a left parenthesis and its corresponding right parenthesis. An arithmetic combination of terms is evaluated as described in “Expressions” on page 44. Figure 12 summarizes the various types of terms, and gives a reference to the page number that discusses the term and the rules for using it. Figure 12 (Page 1 of 2). Summary of Terms Terms Term can be absolute Term can be relocatable Value is assigned by assembler Value is inherent in term Symbols X X X 29 | Literals X X X 41 Self-defining terms X X 34 Page reference 28 HLASM V1R5 Language Reference
Terms, Literals, and Expressions Figure 12 (Page 2 of 2). Summary of Terms Terms Location counter reference Symbol length attribute Other data attributes Term can be absolute Notes: 1. Other valid data attributes are S and I. Term can be relocatable Value is assigned by assembler Value is inherent in term X X 36 X X 38 X X 40 Page reference | For more information about absolute and relocatable expressions, see “Absolute | and Relocatable Expressions” on page 47. Symbols You can use a symbol to represent storage locations or arbitrary values. If you write a symbol in the name field of an instruction, you can then specify this symbol in the operands of other instructions and thus refer to the former instruction symbolically. This symbol represents a relocatable address. You can also assign an absolute value to a symbol by coding it in the name field of an EQU instruction with an operand whose value is absolute. This lets you use this symbol in instruction operands to represent: Registers Displacements in explicit addresses Immediate data Lengths Implicit addresses with absolute values For details of these program elements, see “Operand Entries” on page 85. The advantages of symbolic over numeric representation are: Symbols are easier to remember and use than numeric values, thus reducing programming errors and increasing programming efficiency. You can use meaningful symbols to describe the program elements they represent. For example, INPUT can name a field that is to contain input data, or INDEX can name a register to be used for indexing. You can change the value of one symbol that is used in many instructions (through an EQU instruction) more easily than you can change several numeric values in many instructions. | If the symbols are relocatable, the assembler can calculate displacements and | assign base registers for you. Symbols are entered into a cross reference table that is printed in the Ordinary Symbol and Literal Cross Reference section of the assembler listing. The cross reference helps you find a symbol in the source and object section of the listing because it shows: Chapter 2. Coding and Structure 29
- 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 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 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
Terms, Literals, and Expressions<br />
Figure 12 (Page 2 of 2). Summary of Terms<br />
Terms<br />
Location counter<br />
reference<br />
Symbol length<br />
attribute<br />
Other data<br />
attributes<br />
Term<br />
can be<br />
absolute<br />
Notes:<br />
1. Other valid data attributes are S and I.<br />
Term can<br />
be<br />
relocatable<br />
Value is<br />
assigned<br />
by<br />
assembler<br />
Value is<br />
inherent<br />
in term<br />
X X 36<br />
X X 38<br />
X X 40<br />
Page<br />
reference<br />
| For more information about absolute and relocatable expressions, see “Absolute<br />
| and Relocatable Expressions” on page 47.<br />
Symbols<br />
You can use a symbol to represent storage locations or arbitrary values. If you<br />
write a symbol in the name field of an instruction, you can then specify this symbol<br />
in the operands of other instructions and thus refer to the former instruction<br />
symbolically. This symbol represents a relocatable address.<br />
You can also assign an absolute value to a symbol by coding it in the name field of<br />
an EQU instruction with an operand whose value is absolute. This lets you use this<br />
symbol in instruction operands to represent:<br />
Registers<br />
Displacements in explicit addresses<br />
Immediate data<br />
Lengths<br />
Implicit addresses with absolute values<br />
For details of these program elements, see “Operand Entries” on page 85.<br />
The advantages of symbolic over numeric representation are:<br />
Symbols are easier to remember and use than numeric values, thus reducing<br />
programming errors and increasing programming efficiency.<br />
You can use meaningful symbols to describe the program elements they<br />
represent. For example, INPUT can name a field that is to contain input data, or<br />
INDEX can name a register to be used for indexing.<br />
You can change the value of one symbol that is used in many instructions<br />
(through an EQU instruction) more easily than you can change several numeric<br />
values in many instructions.<br />
| If the symbols are relocatable, the assembler can calculate displacements and<br />
| assign base registers for you.<br />
Symbols are entered into a cross reference table that is printed in the Ordinary<br />
Symbol and Literal Cross <strong>Reference</strong> section of the assembler listing. The cross<br />
reference helps you find a symbol in the source and object section of the listing<br />
because it shows:<br />
Chapter 2. Coding and Structure 29