Dependent USING instruction

The dependent USING instruction format specifies a base address and a relocatable expression instead of one or more base registers. If a USING label is also specified, this format USING instruction is called a labeled dependent USING instruction.

Dependent USING

Read syntax diagramSkip visual syntax diagramlabelsequence_symbolUSINGbase( base,end,lower,upper), address
label
Is one of the following:
  • An ordinary symbol
  • A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol
sequence_symbol
Is a sequence symbol.
base
Specifies a base address, which must be a relocatable expression. The value of the expression must lie between 0 and 231-1.
end
Specifies the end address, which can be a relocatable or an absolute expression. The value of the expression must lie between 0 and 231-1. The end address can exceed the (base address + default range) without error. The end address must be greater than the base and must have the same relocatable attributes.
lower
Specifies a lower limit for the addressability range, which applies both for 12-bit displacements and for long displacements. The lower limit must have the same relocatable attribute as the base and can have any negative or positive offset from the location addressed by the first base register. An offset of x'80000000' is equivalent to no limit.
upper
Specifies an upper limit for the addressability range, which applies both for 12-bit displacement and for long displacements. This is one more than the maximum addressable byte address, than for the end limit. The upper limit must have the same relocatable attribute as the base and can have any negative or positive offset from the location addressed by the first base register. However, if a lower limit is present, the upper limit must be greater than the lower limit. An offset of x'80000000' is equivalent to no limit.
address
Is a simply relocatable expression that represents an implicit address within the range of an active USING instruction. The range of an active USING is considered to be that which is valid for generating 12 bit displacements, or signed 20 bit displacements if the specified OPTABLE level includes support for instructions with displacements in this form.

The implicit address denoted by address specifies the address where base is to be based, and is known as the supporting base address. As address is a relocatable expression, it distinguishes a dependent USING from an ordinary USING. The assembler converts the implicit address denoted by address into its explicit base-displacement form. It then assigns the base register from this explicit address as the base register for base. The assembler assumes that the base register contains the base address base minus the displacement determined in the explicit address. The assembler also assumes that address is appropriately aligned for the code based on base. Warnings are not issued for potential alignment problems in the dependent USING address.

A dependent USING depends on the presence of one or more corresponding labeled or ordinary USINGs being in effect to resolve the symbolic expressions in the range of the dependent USING.

The following example shows the use of an unlabeled dependent USING:
EXAMPLE  CSECT
         USING  EXAMPLE,R10,R11                 Ordinary USING
         .
         .
         USING  IHADCB,DCBUT2                   Unlabeled dependent USING
         LH     R0,DCBBLKSI                     Uses R10 or R11 for BASE
         .
         .
DCBUT2   DCB    DDNAME=SYSUT2,...
The following example shows the use of two labeled dependent USINGs:
EXAMPLE  CSECT
         USING  EXAMPLE,R10,R11                 Ordinary USING
         .
         .
DCB1     USING  IHADCB,DCBUT1                   Labeled dependent USING
DCB2     USING  IHADCB,DCBUT2                   Labeled dependent USING
         MVC    DCB2.DCBBLKSI,DCB1.DCBBLKSI     Uses R10 or R11 for BASE
         .
         .
DCBUT1   DCB    DDNAME=SYSUT1,...
DCBUT2   DCB    DDNAME=SYSUT2,...