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


Dependent USING instruction

HLASM Language Reference
SC26-4940-06

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.
Read syntax diagramSkip visual syntax diagram
Dependent USING

>>-+-----------------+-USING-+-base-------------+-,address-----><
   +-label-----------+       '-(base-+------+-)-'            
   '-sequence_symbol-'               '-,end-'                

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.
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 or 20 bit displacements.
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 relocatability attributes.

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,...

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014