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 |
|---|
|
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,...
The range of a dependent USING instruction (called the dependent USING range) is either the range as specified by the range end, or the range of the corresponding USING minus the offset of address within that range, whichever is the lesser. If the corresponding labeled or ordinary USING assigns more than one base register, the maximum dependent USING range is the composite USING range of the labeled or ordinary USING.
If the dependent USING instruction specifies a supporting base address that is within the range of more than one ordinary USING, the assembler determines which base register to use during base-displacement resolution as follows:
The domain of a dependent USING instruction (called the dependent USING domain) begins where the dependent USING appears in the source module and continues until the end of the source module, except when:
When a labeled dependent USING domain is dropped, none of any subordinate USING domains are dropped. In the following example the labeled dependent USING BLBL1 is not dropped, even though it appears to be dependent on the USING ALBL2 that is being dropped:
ALBL1 USING DSECTA,14
USING DSECTB,ALBL1.A
.
.
ALBL2 USING DSECTA,ALBL1.A
.
BLBL1 USING DSECTA,ALBL2.A
.
DROP ALBL2
.
DSECTA DSECT
A DS A
DSECTB DSECT
B DS A
A dependent USING is not dependent on another dependent USING. It is dependent on the ordinary or labeled USING that is finally used to resolve the address. For example, the USING at BLBL1 is dependent on the ALBL1 USING.
Remember that all dependent USINGs must eventually be based on an ordinary or labeled USING that provides the base register used for base-displacement resolutions.
[ Top of Page | Previous Page | Next Page | Contents | Index ]