HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Range of an ordinary USING instruction

HLASM Language Reference
SC26-4940-06

The 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, 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 applies if the base registers were specified in separate USING instructions.

USING ranges need not be contiguous. For example, you can specify
      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.

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 do not receive a diagnostic message if you code the following statements:
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.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014