HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Terms, Literals, and Expressions “Location Counter Reference” on page 37 describes how you can use the current location counter in a literal. | The rules for determining whether two literals are identical are: | 1. A literal which contains a location counter reference is not identical to any other | literal. | 2. Otherwise, two literals are identical (and will be generated only once), if their | source forms are identical. Contrast with Immediate Data: You should not confuse a literal with the immediate data in an SI instruction. Immediate data is assembled into the instruction. Literal Pool The literals processed by the assembler are collected and placed in a special area called the literal pool. You can control the positioning of the literal pool. Unless otherwise specified, the literal pool is placed at the end of the first control section. You can also specify that multiple literal pools be created. However, the assembler controls the sequence in which literals are ordered within the pool. Further information on positioning literal pools is in “LTORG Instruction” on page 193. Expressions This section discusses the expressions used in coding operand entries for source statements. You can use an expression to specify: An address An explicit length A modifier A duplication factor A complete operand Expressions have absolute and relocatable values. Whether an expression is absolute or relocatable depends on the value of the terms it contains. The assembler evaluates relocatable and absolute expressions at assembly time. Figure 16 on page 45 shows examples of valid expressions. | In addition to expressions used in coding operand entries, there are three types of expression that you can use only in conditional assembly instructions: arithmetic, logical, and character expressions. They are evaluated during conditional | assembly. For more information, see “Assigning Values to SET Symbols” on | page 347. An expression is composed of a single term or an arithmetic combination of terms. The assembler reduces multiterm expressions to single values. Thus, you do not have to compute these values yourself. The following are examples of valid expressions: 44 HLASM V1R5 Language Reference
Terms, Literals, and Expressions BETA1 AREA1+X'2D' B'11' +32 C'ABC' N–25 29 FIELD+332 L'FIELD FIELD LAMBDA+GAMMA (EXIT–ENTRY+1)+GO TEN/TWO ALPHA–BETA/(1+AREAL'FIELD)–1 =F'1234' =A(1,133,175,221)+8 Figure 16. Examples of Valid Expressions Rules for Coding Expressions The rules for coding an absolute or relocatable expression are: Unary (operating on one value) operators and binary (operating on two values) operators are allowed in expressions. An expression can have one or more unary operators preceding any term in the expression or at the beginning of the expression. An expression must not begin with a binary operator, nor can it contain two | binary operators in succession. When + and − are used as prefix operators, | then they are unary, and not binary, operators. | An expression starting with is interpreted as a location counter reference, and | not a multiplication operator. An expression must not contain two terms in succession. No spaces are allowed between an operator and a term, nor between two successive operators. An expression can contain any number of unary and binary operators, and any number of levels of parentheses. A single relocatable term is not allowed in a multiply or divide operation. Note that paired relocatable terms have absolute values and can be multiplied and divided if they are enclosed in parentheses. See “Paired Relocatable Terms” on page 47. Figure 17 on page 46 shows the definitions of absolute and relocatable expressions. Chapter 2. Coding and Structure 45
- 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 62 and 63: Terms, Literals, and Expressions 1.
- 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
- Page 112 and 113: Examples of Coded Machine Instructi
Terms, Literals, and Expressions<br />
<br />
BETA1<br />
AREA1+X'2D'<br />
B'11'<br />
+32 C'ABC'<br />
N–25 29<br />
FIELD+332<br />
L'FIELD<br />
FIELD<br />
LAMBDA+GAMMA<br />
(EXIT–ENTRY+1)+GO<br />
TEN/TWO<br />
ALPHA–BETA/(1+AREAL'FIELD)–1 =F'1234'<br />
=A(1,133,175,221)+8<br />
Figure 16. Examples of Valid Expressions<br />
Rules for Coding Expressions<br />
The rules for coding an absolute or relocatable expression are:<br />
Unary (operating on one value) operators and binary (operating on two values)<br />
operators are allowed in expressions.<br />
An expression can have one or more unary operators preceding any term in<br />
the expression or at the beginning of the expression.<br />
An expression must not begin with a binary operator, nor can it contain two<br />
| binary operators in succession. When + and − are used as prefix operators,<br />
| then they are unary, and not binary, operators.<br />
| An expression starting with is interpreted as a location counter reference, and<br />
| not a multiplication operator.<br />
An expression must not contain two terms in succession.<br />
No spaces are allowed between an operator and a term, nor between two<br />
successive operators.<br />
An expression can contain any number of unary and binary operators, and any<br />
number of levels of parentheses.<br />
A single relocatable term is not allowed in a multiply or divide operation. Note<br />
that paired relocatable terms have absolute values and can be multiplied and<br />
divided if they are enclosed in parentheses. See “Paired Relocatable Terms”<br />
on page 47.<br />
Figure 17 on page 46 shows the definitions of absolute and relocatable<br />
expressions.<br />
Chapter 2. Coding and Structure 45