HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Operand Entries “Program Structures and Addressing” on page 50 describes how you use symbolic addresses to refer to data in your assembler language program. Defining Symbolic Addresses: Define relocatable addresses by either using a symbol as the label in the name field of an assembler language statement, or equating a symbol to a relocatable expression. Define absolute addresses (or values) by equating a symbol to an absolute expression. Referring to Addresses: You can refer to relocatable and absolute addresses in the operands of machine instruction statements. (Such address references are also called addresses in this manual.) The two ways of coding addresses are: Implicitly—in a form that the assembler must first convert into an explicit relative-offset or base-displacement form before it can be assembled into object code. Explicitly—in a form that can be directly assembled into object code. Implicit Address An implicit address is specified by coding one expression. The expression can be relocatable or absolute. The assembler converts all implicit addresses into their relative-offset or base-displacement form before it assembles them into object code. The assembler converts implicit addresses into explicit base-displacement addresses only if a USING instruction has been specified, or for small absolute expressions, where the address is resolved without a USING. The USING instruction assigns both a base address, from which the assembler computes displacements, and a base register, which is assumed to contain the base address. The base register must be loaded with the correct base address at execution time. For more information, refer to “Addressing” on page 63. Explicit Address An explicit address is specified by coding two absolute expressions as follows: The first is an absolute expression for the displacement, whose value must lie in the range 0 through 4095 (4095 is the maximum value that can be represented by the 12 binary bits available for the displacement in the object code). The second (enclosed in parentheses) is an absolute expression for the base register, whose value must lie in the range 0 through 15. An explicit base register designation must not accompany an implicit address. However, in RX-format instructions, an index register can be coded with an implicit address as well as with an explicit address. When two addresses are required, each address can be coded as an explicit address or as an implicit address. Relative Address A relative address is specified by coding one expression. The expression may be relocatable or absolute. If a relocatable expression is used, then the assembler converts the value to a signed number of halfwords relative to the current location counter, and then uses that value in the object code. An absolute value may be used for a relative address, but the assembler issues a warning message, as it uses the supplied value, and this may cause unpredictable results. 88 HLASM V1R5 Language Reference
Operand Entries Relocatability of Addresses If the value of an address expression changes when the assumed origin of the program is changed, and changes by the same amount, then the address is simply relocatable. If the addressing expression does not change when the assumed origin of the program is changed, then that address is absolute. If the addressing expression changes by some other amount, the address may be complexly relocatable. Addresses in the relative-offset or base-displacement form are relocatable, because: Each relocatable address is assembled as a signed relative offset from the instruction, or as a displacement from a base address and a base register. The base register contains the base address. If the object module assembled from your source module is relocated, only the contents of the base register need reflect this relocation. This means that the location in virtual storage of your base has changed, and that your base register must contain this new base address. Addresses in your program have been assembled as relative to the base address; therefore, the sum of the displacement and the contents of the base register point to the correct address after relocation. Absolute addresses are also assembled in the base-displacement form, but always indicate a fixed location in virtual storage. This means that the contents of the base register must always be a fixed absolute address value regardless of relocation. Machine or Object Code Format Addresses assembled into the object code of machine instructions have the format given in Figure 23 on page 90. Not all of the instruction formats are shown in Figure 23. The addresses represented have a value that is the sum of a displacement (see ▌1▐ in Figure 23) and the contents of a base register (see ▌2▐ in Figure 23). Index Register: In RX-format instructions, the address represented has a value that is the sum of a displacement, the contents of a base register, and the contents of an index register (see ▌3▐ in Figure 23). Chapter 4. Machine Instruction Statements 89
- 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
- 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 110 and 111: Operand Entries Format │ Coded or
- Page 112 and 113: Examples of Coded Machine Instructi
- Page 114 and 115: Examples of Coded Machine Instructi
- Page 116 and 117: Examples of Coded Machine Instructi
- Page 118 and 119: Examples of Coded Machine Instructi
- Page 120 and 121: Chapter 5. Assembler Instruction St
- Page 122 and 123: *PROCESS Statement *PROCESS Stateme
- Page 124 and 125: ACONTROL Instruction ►►──
- Page 126 and 127: ACONTROL Instruction FLAG(PAGE0) in
- Page 128 and 129: AINSERT Instruction character_strin
- Page 130 and 131: AMODE Instruction alias_string is t
- Page 132 and 133: CATTR Instruction Figure 25. AMODE/
- Page 134 and 135: CATTR Instruction | statements for
- Page 136 and 137: CCW1 Instruction data_count is an a
- Page 138 and 139: CEJECT Instruction If symbol is an
- Page 140 and 141: CNOP Instruction Figure 29 (Page 2
- Page 142 and 143: COPY Instruction In the following e
- Page 144 and 145: CSECT Instruction symbol in the nam
- Page 146 and 147: DC Instruction ROUTINE B GAMMA DXD
- Page 148 and 149: DC Instruction duplication_factor c
- Page 150 and 151: DC Instruction Figure 33 (Page 2 of
- Page 152 and 153: DC Instruction With EBCDIC spaces
- Page 154 and 155: DC Instruction Further information
- Page 156 and 157: DC Instruction | Symbols used in su
Operand Entries<br />
“Program Structures and Addressing” on page 50 describes how you use symbolic<br />
addresses to refer to data in your assembler language program.<br />
Defining Symbolic Addresses: Define relocatable addresses by either using a<br />
symbol as the label in the name field of an assembler language statement, or<br />
equating a symbol to a relocatable expression.<br />
Define absolute addresses (or values) by equating a symbol to an absolute<br />
expression.<br />
Referring to Addresses: You can refer to relocatable and absolute addresses in<br />
the operands of machine instruction statements. (Such address references are<br />
also called addresses in this manual.) The two ways of coding addresses are:<br />
Implicitly—in a form that the assembler must first convert into an explicit<br />
relative-offset or base-displacement form before it can be assembled into object<br />
code.<br />
Explicitly—in a form that can be directly assembled into object code.<br />
Implicit Address<br />
An implicit address is specified by coding one expression. The expression can be<br />
relocatable or absolute. The assembler converts all implicit addresses into their<br />
relative-offset or base-displacement form before it assembles them into object code.<br />
The assembler converts implicit addresses into explicit base-displacement<br />
addresses only if a USING instruction has been specified, or for small absolute<br />
expressions, where the address is resolved without a USING. The USING<br />
instruction assigns both a base address, from which the assembler computes<br />
displacements, and a base register, which is assumed to contain the base address.<br />
The base register must be loaded with the correct base address at execution time.<br />
For more information, refer to “Addressing” on page 63.<br />
Explicit Address<br />
An explicit address is specified by coding two absolute expressions as follows:<br />
The first is an absolute expression for the displacement, whose value must lie<br />
in the range 0 through 4095 (4095 is the maximum value that can be<br />
represented by the 12 binary bits available for the displacement in the object<br />
code).<br />
The second (enclosed in parentheses) is an absolute expression for the base<br />
register, whose value must lie in the range 0 through 15.<br />
An explicit base register designation must not accompany an implicit address.<br />
However, in RX-format instructions, an index register can be coded with an implicit<br />
address as well as with an explicit address. When two addresses are required,<br />
each address can be coded as an explicit address or as an implicit address.<br />
Relative Address<br />
A relative address is specified by coding one expression. The expression may be<br />
relocatable or absolute. If a relocatable expression is used, then the assembler<br />
converts the value to a signed number of halfwords relative to the current location<br />
counter, and then uses that value in the object code. An absolute value may be<br />
used for a relative address, but the assembler issues a warning message, as it<br />
uses the supplied value, and this may cause unpredictable results.<br />
88 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>