HLASM Language Reference
HLASM Language Reference HLASM Language Reference
USING Instruction Only the characters printed in the heading count toward the maximum of 100 characters allowed. If the count of characters to be printed exceeds 100, the heading that is printed is truncated and error diagnostic message ASMA62E Illegal operand format is issued. USING Instruction The USING instruction specifies a base address and range and assigns one or more base registers. If you also load the base register with the base address, you have established addressability in a control section. If a control section has not been established, USING will initiate an unnamed (private) control section. To use the USING instruction correctly, you should know: Which locations in a control section are made addressable by the USING instruction Where in a source module you can use implicit addresses in instruction operands to refer to these addressable locations Base Address: The term base address is used throughout this manual to mean the location counter value within a control section from which the assembler can compute displacements to locations, or addresses, within the control section. Don't confuse this with the storage address of a control section when it is loaded into storage at execution time. The USING instruction has three formats: The first format specifies a base address, an optional range, and one or more base registers. This format of the USING instruction is called an ordinary USING instruction, and is described under “Ordinary USING Instruction” on page 220. The second format specifies a base address, an optional range, one or more base registers, and a USING label which may be used as a symbol qualifier. This format of the USING instruction is called a labeled USING instruction, and is described under “Labeled USING Instruction” on page 223. The third format specifies a base address, an optional range, and a relocatable expression instead of one or more base registers. This format of a USING instruction is called a dependent USING instruction, and is described under “Dependent USING Instruction” on page 226. If a USING label is also specified, this format of the USING instruction is called a labeled dependent USING instruction. Note: The assembler identifies and warns about statements where the implied alignment of an operand does not match the requirements of the instruction. However, if the base for a USING is not aligned on the required boundary, the assembler cannot diagnose a problem. For example: 218 HLASM V1R5 Language Reference
USING Instruction DS1 DSECT DS H | REGPAIR DS 2ADL8 Halfword alignment DS2 DSECT | REGPAIR_ALIGN DS 2ADL8 Doubleword alignment CSECT ... USING DS1,R1 Ordinary USING | USING DS2,REGPAIR Dependent USING | STPQ R,REGPAIR REGPAIR is not a quadword | STPQ R,REGPAIR_ALIGN But REGPAIR_ALIGN is | The first STPQ instruction is diagnosed as an alignment error. The second STPQ instruction is not, even though the same storage location is implied by the code. You must take care to ensure base addresses match the alignment requirements of storage mapped by a USING. For a description of the alignment requirements of instructions, see the relevant Principles of Operation. How to Use the USING Instruction Specify the USING instruction so that: All the required implicit addresses in each control section lie within a USING range. All the references for these addresses lie within the corresponding USING domain. You could, therefore, place all ordinary USING instructions at the beginning of the control section and specify a base address in each USING instruction that lies at the beginning of each control section. For Executable Control Sections: To establish the addressability of an executable control section defined by a START or CSECT instruction, specify a base address and assign a base register in the USING instruction. At execution time, the base register must be loaded with the correct base address. If a control section requires addressability to more than 4096 bytes, you must | assign more than one base register, or make implicit references using only | instructions supporting 20-bit displacements (“long displacements”). This establishes the addressability of the entire control section with one USING instruction. For Reference Control Sections: A dummy section is a reference control section defined by the DSECT instructions. To establish the addressability of a dummy section, specify the address of the first byte of the dummy section as the base address, so that all its addresses lie within the pertinent USING range. The address you load into the base register must be the address of the storage area | being described by the dummy section. However, if all references to fields withing | the DSECT are made with instructions supporting long displacements, the base | address need not be the first byte of the dummy section. | When you refer to symbolic addresses in the dummy section, the assembler | computes displacements accordingly. However, at execution time, the assembled addresses refer to the location of real data in the storage area. Chapter 5. Assembler Instruction Statements 219
- Page 188 and 189: DC Instruction—Binary Floating-Po
- Page 190 and 191: DC Instruction—Binary Floating-Po
- Page 192 and 193: DROP Instruction DROP Instruction T
- Page 194 and 195: DS Instruction USING DSECTA,14 ALBL
- Page 196 and 197: DS Instruction The size of a storag
- Page 198 and 199: DSECT Instruction DSECT Instruction
- Page 200 and 201: DXD Instruction ASEMBLY2 CSECT USIN
- Page 202 and 203: END Instruction change but no addit
- Page 204 and 205: EQU Instruction EQU Instruction The
- Page 206 and 207: EQU Instruction 5. The length attri
- Page 208 and 209: EXITCTL Instruction sequence_symbol
- Page 210 and 211: ISEQ Instruction must be greater th
- Page 212 and 213: LOCTR Instruction A CSECT , See not
- Page 214 and 215: LTORG Instruction If symbol is an o
- Page 216 and 217: MNOTE Instruction When two literals
- Page 218 and 219: OPSYN Instruction ,ERROR, SEV 1 An
- Page 220 and 221: ORG Instruction AFTER is defined in
- Page 222 and 223: ORG Instruction If you specify mult
- Page 224 and 225: POP Instruction POP Instruction The
- Page 226 and 227: PRINT Instruction Note: If the next
- Page 228 and 229: Process Statement Process Statement
- Page 230 and 231: REPRO Instruction NOPRINT instructs
- Page 232 and 233: RSECT Instruction 4. AMODE or RMODE
- Page 234 and 235: START Instruction START Instruction
- Page 236 and 237: TITLE Instruction The name value is
- Page 240 and 241: USING Instruction Base Registers fo
- Page 242 and 243: USING Instruction If register 0 is
- Page 244 and 245: USING Instruction A variable symbo
- Page 246 and 247: USING Instruction In this MVC instr
- Page 248 and 249: USING Instruction Range of a Depend
- Page 250 and 251: XATTR Instruction external_symbol i
- Page 252 and 253: XATTR Instruction SCOPE ►►─
- Page 254 and 255: XATTR Instruction 234 HLASM V1R5 La
- Page 256 and 257: Part 3. Macro Language &SYSDATC Sys
- Page 258 and 259: Introduction to Macro Language Chap
- Page 260 and 261: Introduction to Macro Language The
- Page 262 and 263: Introduction to Macro Language Macr
- Page 264 and 265: MACRO and MEND Statements The assem
- Page 266 and 267: Prototype Statement Macros that are
- Page 268 and 269: Model Statements generated from tha
- Page 270 and 271: Model Statements ▌5▐ ▌6▐
- Page 272 and 273: Model Statements Notes: 1. You can
- Page 274 and 275: Positional Parameters Symbolic para
- Page 276 and 277: Processing Statements Processing St
- Page 278 and 279: AREAD Instruction Assign Local Time
- Page 280 and 281: COPY Instruction sequence_symbol is
- Page 282 and 283: System Variable Symbols System Vari
- Page 284 and 285: &SYSADATA_MEMBER System Variable Sy
- Page 286 and 287: &SYSCLOCK System Variable Symbol &S
USING Instruction<br />
Only the characters printed in the heading count toward the maximum of 100<br />
characters allowed. If the count of characters to be printed exceeds 100, the<br />
heading that is printed is truncated and error diagnostic message<br />
ASMA62E Illegal operand format<br />
is issued.<br />
USING Instruction<br />
The USING instruction specifies a base address and range and assigns one or<br />
more base registers. If you also load the base register with the base address, you<br />
have established addressability in a control section. If a control section has not<br />
been established, USING will initiate an unnamed (private) control section.<br />
To use the USING instruction correctly, you should know:<br />
Which locations in a control section are made addressable by the USING<br />
instruction<br />
Where in a source module you can use implicit addresses in instruction<br />
operands to refer to these addressable locations<br />
Base Address: The term base address is used throughout this manual to mean<br />
the location counter value within a control section from which the assembler can<br />
compute displacements to locations, or addresses, within the control section. Don't<br />
confuse this with the storage address of a control section when it is loaded into<br />
storage at execution time.<br />
The USING instruction has three formats:<br />
The first format specifies a base address, an optional range, and one or more<br />
base registers. This format of the USING instruction is called an ordinary<br />
USING instruction, and is described under “Ordinary USING Instruction” on<br />
page 220.<br />
The second format specifies a base address, an optional range, one or more<br />
base registers, and a USING label which may be used as a symbol qualifier.<br />
This format of the USING instruction is called a labeled USING instruction, and<br />
is described under “Labeled USING Instruction” on page 223.<br />
The third format specifies a base address, an optional range, and a relocatable<br />
expression instead of one or more base registers. This format of a USING<br />
instruction is called a dependent USING instruction, and is described under<br />
“Dependent USING Instruction” on page 226. If a USING label is also<br />
specified, this format of the USING instruction is called a labeled dependent<br />
USING instruction.<br />
Note: The assembler identifies and warns about statements where the implied<br />
alignment of an operand does not match the requirements of the instruction.<br />
However, if the base for a USING is not aligned on the required boundary, the<br />
assembler cannot diagnose a problem. For example:<br />
218 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>