Range of an ordinary USING instruction
For instructions with 12-bit displacements, the maximum range of an ordinary USING instruction (called the "ordinary USING range", or the "USING range") is the 4096 bytes beginning at the base address specified in the USING instruction. For long-displacement instructions, the maximum range is the addresses between (base_address-524288) and (base_address+524287).
The range for 12-bit displacements may be limited by specifying an end limit address which is less than the end of the maximum range. The range for both types of displacement may be limited by specifying lower and upper limit values.
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 applies if the base registers were specified in separate USING instructions.
USING X,4
USING X+6000,5
and implicit addresses with values X+4096
- X+5999 are not 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 terminated, the domain of the other USING instruction is resumed.
PSTART CSECT
LR R12,R15
LA R11,4095(,R12)
USING PSTART,R12
USING PSTART+4095,R11
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 do not want the USING ranges to overlap, you
can code the following statements:
PSTART CSECT
LR R12,R15
LA R11,4095(,R12)
LA R11,1(,R11)
USING PSTART,R12
USING PSTART+4096,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.