HLASM Language Reference
HLASM Language Reference HLASM Language Reference
USING Instruction If register 0 is used as a base register, the referenced control section (or dummy section) is not relocatable, despite the fact that operand base may be relocatable. The control section can be made relocatable by: Replacing register 0 in the USING statement Loading the new register with a relocatable value Reassembling the program Range of an Ordinary USING Instruction The range of an ordinary USING instruction (called the ordinary USING range, or simply the USING range) is the 4096 bytes beginning at the base address specified in the USING instruction, or the range as specified by the range end, whichever is | the lesser. For long-displacement instructions, the range is the addresses between | (base_address-524288) and (base_address+524287). Addresses that lie within the USING range can be converted from their implicit to their explicit base-displacement form using the designated base registers; those outside the USING range cannot be converted. The USING range does not depend upon the position of the USING instruction in the source module; rather, it depends upon the location of the base address specified in the USING instruction. The USING range is the range of addresses in a control section that is associated with the base register specified in the USING instruction. If the USING instruction assigns more than one base register, the composite USING range is the union of the USING ranges that would apply if the base registers were specified in separate USING instructions. | Note that USING ranges need not be contiguous. For example, you could specify | USING X,4 | USING X+6,5 | and implicit addresses with values between X+4096 and X+5999 would not be | addressable by instructions with unsigned 12-bit displacements. Two USING ranges coincide when the same base address is specified in two different USING instructions, even though the base registers used are different. When two USING ranges coincide, the assembler uses the higher-numbered register for assembling the addresses within the common USING range. In effect, the domain of the USING instruction that specifies the lower-numbered register is ended by the other USING instruction. If the domain of the USING instruction that specifies the higher-number register is subsequently terminated, the domain of the other USING instruction is resumed. Two USING ranges overlap when the base address of one USING instruction lies within the range of another USING instruction. You can use the WARN suboption of the USING assembler option to find out if you have any overlapping USING ranges. When an overlap occurs the assembler issues a diagnostic message. However, the assembler does allow an overlap of one byte in USING ranges so that you don't receive a diagnostic message if you code the following statements: PSTART CSECT LR R12,R15 LA R11,495(,R12) USING PSTART,R12 USING PSTART+495,R11 222 HLASM V1R5 Language Reference
USING Instruction In the above example, the second USING instruction begins the base address of the second base register (R11) in the 4096th byte of the first base register (R12) USING range. If you don't want the USING ranges to overlap, you can code the following statements: PSTART CSECT LR R12,R15 LA R11,495(,R12) LA R11,1(,R11) USING PSTART,R12 USING PSTART+496,R11 | When two ranges overlap, the assembler computes displacements from the base | address that gives the smallest non-negative displacement; or if no non-negative | displacement can be found, for long-displacement instructions, the base register | giving the smallest negative displacement; it uses the corresponding base register | when it assembles the addresses within the range overlap. This applies only to | implicit addresses that appear after the second USING instruction. | LOCTR does not affect the USING domain. Domain of an Ordinary USING Instruction The domain of an ordinary USING instruction (called the ordinary USING domain, or simply the USING domain) begins where the USING instruction appears in a source module. It continues until the end of a source module, except when: A subsequent DROP instruction specifies the same base register or registers assigned by a preceding USING instruction. A subsequent USING instruction specifies the same register or registers assigned by a preceding USING instruction. The assembler converts implicit address references into their explicit form when the following conditions are met: The address reference appears in the domain of a USING instruction. The addresses referred to lie within the range of some USING instruction. The assembler does not convert implicit address references that are outside the USING domain. The USING domain depends on the position of the USING instruction in the source module after conditional assembly, if any, has been done. Labeled USING Instruction The labeled USING instruction specifies a base address, one or more base registers, and a USING label which can be used as a symbol qualifier. Labeled USING ┌ ──────────────┐ ►►──label──USING──┬─base─────────────┬─── ▼ ,base_register┴───────────►◄ └ ─(base─┬────── ┬─) ─┘ └─,end─┘ label is one of the following: An ordinary symbol Chapter 5. Assembler Instruction Statements 223
- 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 238 and 239: USING Instruction Only the characte
- Page 240 and 241: USING Instruction Base Registers fo
- 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
- Page 288 and 289: &SYSECT System Variable Symbol depe
- Page 290 and 291: &SYSIN_MEMBER System Variable Symbo
USING Instruction<br />
If register 0 is used as a base register, the referenced control section (or dummy<br />
section) is not relocatable, despite the fact that operand base may be relocatable.<br />
The control section can be made relocatable by:<br />
Replacing register 0 in the USING statement<br />
Loading the new register with a relocatable value<br />
Reassembling the program<br />
Range of an Ordinary USING Instruction<br />
The range of an ordinary USING instruction (called the ordinary USING range, or<br />
simply the USING range) is the 4096 bytes beginning at the base address specified<br />
in the USING instruction, or the range as specified by the range end, whichever is<br />
| the lesser. For long-displacement instructions, the range is the addresses between<br />
| (base_address-524288) and (base_address+524287). Addresses that lie within the<br />
USING range can be converted from their implicit to their explicit<br />
base-displacement form using the designated base registers; those outside the<br />
USING range cannot be converted.<br />
The USING range does not depend upon the position of the USING instruction in<br />
the source module; rather, it depends upon the location of the base address<br />
specified in the USING instruction.<br />
The USING range is the range of addresses in a control section that is associated<br />
with the base register specified in the USING instruction. If the USING instruction<br />
assigns more than one base register, the composite USING range is the union of<br />
the USING ranges that would apply if the base registers were specified in separate<br />
USING instructions.<br />
| Note that USING ranges need not be contiguous. For example, you could specify<br />
| USING X,4<br />
| USING X+6,5<br />
| and implicit addresses with values between X+4096 and X+5999 would not be<br />
| addressable by instructions with unsigned 12-bit displacements.<br />
Two USING ranges coincide when the same base address is specified in two<br />
different USING instructions, even though the base registers used are different.<br />
When two USING ranges coincide, the assembler uses the higher-numbered<br />
register for assembling the addresses within the common USING range. In effect,<br />
the domain of the USING instruction that specifies the lower-numbered register is<br />
ended by the other USING instruction. If the domain of the USING instruction that<br />
specifies the higher-number register is subsequently terminated, the domain of the<br />
other USING instruction is resumed.<br />
Two USING ranges overlap when the base address of one USING instruction lies<br />
within the range of another USING instruction. You can use the WARN suboption<br />
of the USING assembler option to find out if you have any overlapping USING<br />
ranges. When an overlap occurs the assembler issues a diagnostic message.<br />
However, the assembler does allow an overlap of one byte in USING ranges so<br />
that you don't receive a diagnostic message if you code the following statements:<br />
PSTART CSECT<br />
LR R12,R15<br />
LA R11,495(,R12)<br />
USING PSTART,R12<br />
USING PSTART+495,R11<br />
222 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>