HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

USING Instruction In this MVC instruction, the (unqualified) first operand is resolved with the ordinary USING, and the (qualified) second operand is resolved with the labeled USING. Domain of a Labeled USING Instruction The domain of a labeled USING instruction (called the labeled USING domain) begins where the USING instruction appears in a source module. It continues to the end of the source module, except when: A subsequent DROP instruction specifies the label used in the preceding labeled USING instruction. A subsequent USING instruction specifies the same label used in the preceding labeled USING instruction. The second specification of the label causes the assembler to end the domain of the prior USING with the same label. You can specify the same base register or registers in any number of labeled USING instructions. However, unlike ordinary USING instructions, as long as all the labeled USINGs have unique labels, the assembler considers the domains of all the labeled USINGs to be active and their labels eligible to be used as symbol qualifiers. With ordinary USINGs, when you specify the same base register in a subsequent USING instruction, the domain of the prior USING is ended. The assembler converts implicit address references into their explicit form using the base register or registers specified in a labeled USING instruction when the following conditions are met: The address reference appears in the domain of the labeled USING instruction. The address reference takes the form of a qualified symbol and the qualifier is the label of the labeled USING instruction. | The address lies within the range of the labeled USING instruction. 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 ►►───┬─────────────────┬─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. 226 HLASM V1R5 Language Reference

USING Instruction base specifies a base address, which must be a relocatable expression. The value of the expression must lie between 0 and 2 31 −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 2 31 −1. The end address may 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,R1,R11 Ordinary USING . . USING IHADCB,DCBUT2 Unlabeled dependent USING LH R,DCBBLKSI Uses R1 or R11 for BASE . . DCBUT2 DCB DDNAME=SYSUT2,... The following example shows the use of two labeled dependent USINGs: EXAMPLE CSECT USING EXAMPLE,R1,R11 Ordinary USING . . DCB1 USING IHADCB,DCBUT1 Labeled dependent USING DCB2 USING IHADCB,DCBUT2 Labeled dependent USING MVC DCB2.DCBBLKSI,DCB1.DCBBLKSI Uses R1 or R11 for BASE . . DCBUT1 DCB DDNAME=SYSUT1,... DCBUT2 DCB DDNAME=SYSUT2,... Chapter 5. Assembler Instruction Statements 227

USING Instruction<br />

base<br />

specifies a base address, which must be a relocatable expression. The value<br />

of the expression must lie between 0 and 2 31 −1.<br />

address<br />

is a simply relocatable expression that represents an implicit address within the<br />

| range of an active USING instruction. The range of an active USING is<br />

| considered to be that which is valid for generating 12-bit or 20-bit<br />

| displacements.<br />

end<br />

specifies the end address, which can be a relocatable or an absolute<br />

expression. The value of the expression must lie between 0 and 2 31 −1. The<br />

end address may exceed the (base address + default range) without error. The<br />

end address must be greater than the base and must have the same<br />

relocatability attributes.<br />

The implicit address denoted by address specifies the address where base is to be<br />

based, and is known as the supporting base address. As address is a relocatable<br />

expression, it distinguishes a dependent USING from an ordinary USING. The<br />

assembler converts the implicit address denoted by address into its explicit<br />

base-displacement form. It then assigns the base register from this explicit address<br />

as the base register for base. The assembler assumes that the base register<br />

contains the base address base minus the displacement determined in the explicit<br />

address. The assembler also assumes that address is appropriately aligned for the<br />

code based on base. Warnings are not issued for potential alignment problems in<br />

the dependent USING address.<br />

A dependent USING depends on the presence of one or more corresponding<br />

labeled or ordinary USINGs being in effect to resolve the symbolic expressions in<br />

the range of the dependent USING.<br />

The following example shows the use of an unlabeled dependent USING:<br />

EXAMPLE CSECT<br />

USING EXAMPLE,R1,R11 Ordinary USING<br />

.<br />

.<br />

USING IHADCB,DCBUT2 Unlabeled dependent USING<br />

LH R,DCBBLKSI Uses R1 or R11 for BASE<br />

.<br />

.<br />

DCBUT2 DCB DDNAME=SYSUT2,...<br />

The following example shows the use of two labeled dependent USINGs:<br />

EXAMPLE CSECT<br />

USING EXAMPLE,R1,R11 Ordinary USING<br />

.<br />

.<br />

DCB1 USING IHADCB,DCBUT1 Labeled dependent USING<br />

DCB2 USING IHADCB,DCBUT2 Labeled dependent USING<br />

MVC DCB2.DCBBLKSI,DCB1.DCBBLKSI Uses R1 or R11 for BASE<br />

.<br />

.<br />

DCBUT1 DCB DDNAME=SYSUT1,...<br />

DCBUT2 DCB DDNAME=SYSUT2,...<br />

Chapter 5. Assembler Instruction Statements 227

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!