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 If register 0 is used as a base register, the referenced control section (or dummy section) is not relocatable, despite the fact that operand base may be relocatable. The control section can be made relocatable by: Replacing register 0 in the USING statement Loading the new register with a relocatable value Reassembling the program Range of an Ordinary USING Instruction The range of an ordinary USING instruction (called the ordinary USING range, or simply the USING range) is the 4096 bytes beginning at the base address specified in the USING instruction, or the range as specified by the range end, whichever is | the lesser. For long-displacement instructions, the range is the addresses between | (base_address-524288) and (base_address+524287). Addresses that lie within the USING range can be converted from their implicit to their explicit base-displacement form using the designated base registers; those outside the USING range cannot be converted. The USING range does not depend upon the position of the USING instruction in the source module; rather, it depends upon the location of the base address specified in the USING instruction. The USING range is the range of addresses in a control section that is associated with the base register specified in the USING instruction. If the USING instruction assigns more than one base register, the composite USING range is the union of the USING ranges that would apply if the base registers were specified in separate USING instructions. | Note that USING ranges need not be contiguous. For example, you could specify | USING X,4 | USING X+6,5 | and implicit addresses with values between X+4096 and X+5999 would not be | addressable by instructions with unsigned 12-bit displacements. Two USING ranges coincide when the same base address is specified in two different USING instructions, even though the base registers used are different. When two USING ranges coincide, the assembler uses the higher-numbered register for assembling the addresses within the common USING range. In effect, the domain of the USING instruction that specifies the lower-numbered register is ended by the other USING instruction. If the domain of the USING instruction that specifies the higher-number register is subsequently terminated, the domain of the other USING instruction is resumed. Two USING ranges overlap when the base address of one USING instruction lies within the range of another USING instruction. You can use the WARN suboption of the USING assembler option to find out if you have any overlapping USING ranges. When an overlap occurs the assembler issues a diagnostic message. However, the assembler does allow an overlap of one byte in USING ranges so that you don't receive a diagnostic message if you code the following statements: PSTART CSECT LR R12,R15 LA R11,495(,R12) USING PSTART,R12 USING PSTART+495,R11 222 HLASM V1R5 Language Reference

USING Instruction In the above example, the second USING instruction begins the base address of the second base register (R11) in the 4096th byte of the first base register (R12) USING range. If you don't want the USING ranges to overlap, you can code the following statements: PSTART CSECT LR R12,R15 LA R11,495(,R12) LA R11,1(,R11) USING PSTART,R12 USING PSTART+496,R11 | When two ranges overlap, the assembler computes displacements from the base | address that gives the smallest non-negative displacement; or if no non-negative | displacement can be found, for long-displacement instructions, the base register | giving the smallest negative displacement; it uses the corresponding base register | when it assembles the addresses within the range overlap. This applies only to | implicit addresses that appear after the second USING instruction. | LOCTR does not affect the USING domain. Domain of an Ordinary USING Instruction The domain of an ordinary USING instruction (called the ordinary USING domain, or simply the USING domain) begins where the USING instruction appears in a source module. It continues until the end of a source module, except when: A subsequent DROP instruction specifies the same base register or registers assigned by a preceding USING instruction. A subsequent USING instruction specifies the same register or registers assigned by a preceding USING instruction. The assembler converts implicit address references into their explicit form when the following conditions are met: The address reference appears in the domain of a USING instruction. The addresses referred to lie within the range of some USING instruction. The assembler does not convert implicit address references that are outside the USING domain. The USING domain depends on the position of the USING instruction in the source module after conditional assembly, if any, has been done. Labeled USING Instruction The labeled USING instruction specifies a base address, one or more base registers, and a USING label which can be used as a symbol qualifier. Labeled USING ┌ ──────────────┐ ►►──label──USING──┬─base─────────────┬─── ▼ ,base_register┴───────────►◄ └ ─(base─┬────── ┬─) ─┘ └─,end─┘ label is one of the following: An ordinary symbol Chapter 5. Assembler Instruction Statements 223

USING Instruction<br />

If register 0 is used as a base register, the referenced control section (or dummy<br />

section) is not relocatable, despite the fact that operand base may be relocatable.<br />

The control section can be made relocatable by:<br />

Replacing register 0 in the USING statement<br />

Loading the new register with a relocatable value<br />

Reassembling the program<br />

Range of an Ordinary USING Instruction<br />

The range of an ordinary USING instruction (called the ordinary USING range, or<br />

simply the USING range) is the 4096 bytes beginning at the base address specified<br />

in the USING instruction, or the range as specified by the range end, whichever is<br />

| the lesser. For long-displacement instructions, the range is the addresses between<br />

| (base_address-524288) and (base_address+524287). Addresses that lie within the<br />

USING range can be converted from their implicit to their explicit<br />

base-displacement form using the designated base registers; those outside the<br />

USING range cannot be converted.<br />

The USING range does not depend upon the position of the USING instruction in<br />

the source module; rather, it depends upon the location of the base address<br />

specified in the USING instruction.<br />

The USING range is the range of addresses in a control section that is associated<br />

with the base register specified in the USING instruction. If the USING instruction<br />

assigns more than one base register, the composite USING range is the union of<br />

the USING ranges that would apply if the base registers were specified in separate<br />

USING instructions.<br />

| Note that USING ranges need not be contiguous. For example, you could specify<br />

| USING X,4<br />

| USING X+6,5<br />

| and implicit addresses with values between X+4096 and X+5999 would not be<br />

| addressable by instructions with unsigned 12-bit displacements.<br />

Two USING ranges coincide when the same base address is specified in two<br />

different USING instructions, even though the base registers used are different.<br />

When two USING ranges coincide, the assembler uses the higher-numbered<br />

register for assembling the addresses within the common USING range. In effect,<br />

the domain of the USING instruction that specifies the lower-numbered register is<br />

ended by the other USING instruction. If the domain of the USING instruction that<br />

specifies the higher-number register is subsequently terminated, the domain of the<br />

other USING instruction is resumed.<br />

Two USING ranges overlap when the base address of one USING instruction lies<br />

within the range of another USING instruction. You can use the WARN suboption<br />

of the USING assembler option to find out if you have any overlapping USING<br />

ranges. When an overlap occurs the assembler issues a diagnostic message.<br />

However, the assembler does allow an overlap of one byte in USING ranges so<br />

that you don't receive a diagnostic message if you code the following statements:<br />

PSTART CSECT<br />

LR R12,R15<br />

LA R11,495(,R12)<br />

USING PSTART,R12<br />

USING PSTART+495,R11<br />

222 <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!