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 Only the characters printed in the heading count toward the maximum of 100 characters allowed. If the count of characters to be printed exceeds 100, the heading that is printed is truncated and error diagnostic message ASMA62E Illegal operand format is issued. USING Instruction The USING instruction specifies a base address and range and assigns one or more base registers. If you also load the base register with the base address, you have established addressability in a control section. If a control section has not been established, USING will initiate an unnamed (private) control section. To use the USING instruction correctly, you should know: Which locations in a control section are made addressable by the USING instruction Where in a source module you can use implicit addresses in instruction operands to refer to these addressable locations Base Address: The term base address is used throughout this manual to mean the location counter value within a control section from which the assembler can compute displacements to locations, or addresses, within the control section. Don't confuse this with the storage address of a control section when it is loaded into storage at execution time. The USING instruction has three formats: The first format specifies a base address, an optional range, and one or more base registers. This format of the USING instruction is called an ordinary USING instruction, and is described under “Ordinary USING Instruction” on page 220. The second format specifies a base address, an optional range, one or more base registers, and a USING label which may be used as a symbol qualifier. This format of the USING instruction is called a labeled USING instruction, and is described under “Labeled USING Instruction” on page 223. The third format specifies a base address, an optional range, and a relocatable expression instead of one or more base registers. This format of a USING instruction is called a dependent USING instruction, and is described under “Dependent USING Instruction” on page 226. If a USING label is also specified, this format of the USING instruction is called a labeled dependent USING instruction. Note: The assembler identifies and warns about statements where the implied alignment of an operand does not match the requirements of the instruction. However, if the base for a USING is not aligned on the required boundary, the assembler cannot diagnose a problem. For example: 218 HLASM V1R5 Language Reference

USING Instruction DS1 DSECT DS H | REGPAIR DS 2ADL8 Halfword alignment DS2 DSECT | REGPAIR_ALIGN DS 2ADL8 Doubleword alignment CSECT ... USING DS1,R1 Ordinary USING | USING DS2,REGPAIR Dependent USING | STPQ R,REGPAIR REGPAIR is not a quadword | STPQ R,REGPAIR_ALIGN But REGPAIR_ALIGN is | The first STPQ instruction is diagnosed as an alignment error. The second STPQ instruction is not, even though the same storage location is implied by the code. You must take care to ensure base addresses match the alignment requirements of storage mapped by a USING. For a description of the alignment requirements of instructions, see the relevant Principles of Operation. How to Use the USING Instruction Specify the USING instruction so that: All the required implicit addresses in each control section lie within a USING range. All the references for these addresses lie within the corresponding USING domain. You could, therefore, place all ordinary USING instructions at the beginning of the control section and specify a base address in each USING instruction that lies at the beginning of each control section. For Executable Control Sections: To establish the addressability of an executable control section defined by a START or CSECT instruction, specify a base address and assign a base register in the USING instruction. At execution time, the base register must be loaded with the correct base address. If a control section requires addressability to more than 4096 bytes, you must | assign more than one base register, or make implicit references using only | instructions supporting 20-bit displacements (“long displacements”). This establishes the addressability of the entire control section with one USING instruction. For Reference Control Sections: A dummy section is a reference control section defined by the DSECT instructions. To establish the addressability of a dummy section, specify the address of the first byte of the dummy section as the base address, so that all its addresses lie within the pertinent USING range. The address you load into the base register must be the address of the storage area | being described by the dummy section. However, if all references to fields withing | the DSECT are made with instructions supporting long displacements, the base | address need not be the first byte of the dummy section. | When you refer to symbolic addresses in the dummy section, the assembler | computes displacements accordingly. However, at execution time, the assembled addresses refer to the location of real data in the storage area. Chapter 5. Assembler Instruction Statements 219

USING Instruction<br />

Only the characters printed in the heading count toward the maximum of 100<br />

characters allowed. If the count of characters to be printed exceeds 100, the<br />

heading that is printed is truncated and error diagnostic message<br />

ASMA62E Illegal operand format<br />

is issued.<br />

USING Instruction<br />

The USING instruction specifies a base address and range and assigns one or<br />

more base registers. If you also load the base register with the base address, you<br />

have established addressability in a control section. If a control section has not<br />

been established, USING will initiate an unnamed (private) control section.<br />

To use the USING instruction correctly, you should know:<br />

Which locations in a control section are made addressable by the USING<br />

instruction<br />

Where in a source module you can use implicit addresses in instruction<br />

operands to refer to these addressable locations<br />

Base Address: The term base address is used throughout this manual to mean<br />

the location counter value within a control section from which the assembler can<br />

compute displacements to locations, or addresses, within the control section. Don't<br />

confuse this with the storage address of a control section when it is loaded into<br />

storage at execution time.<br />

The USING instruction has three formats:<br />

The first format specifies a base address, an optional range, and one or more<br />

base registers. This format of the USING instruction is called an ordinary<br />

USING instruction, and is described under “Ordinary USING Instruction” on<br />

page 220.<br />

The second format specifies a base address, an optional range, one or more<br />

base registers, and a USING label which may be used as a symbol qualifier.<br />

This format of the USING instruction is called a labeled USING instruction, and<br />

is described under “Labeled USING Instruction” on page 223.<br />

The third format specifies a base address, an optional range, and a relocatable<br />

expression instead of one or more base registers. This format of a USING<br />

instruction is called a dependent USING instruction, and is described under<br />

“Dependent USING Instruction” on page 226. If a USING label is also<br />

specified, this format of the USING instruction is called a labeled dependent<br />

USING instruction.<br />

Note: The assembler identifies and warns about statements where the implied<br />

alignment of an operand does not match the requirements of the instruction.<br />

However, if the base for a USING is not aligned on the required boundary, the<br />

assembler cannot diagnose a problem. For example:<br />

218 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!