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 Base Registers for Absolute Addresses Absolute addresses used in a source module must also be made addressable. Absolute addresses require a base register other than the base register assigned to relocatable addresses (as described above). However, the assembler does not need a USING instruction to convert absolute implicit addresses in the range 0 through 4095 to their explicit form. The assembler uses register 0 as a base register. Displacements are computed from the base address 0, because the assembler assumes that a base or index of 0 implies that a zero quantity is to be used in forming the address, regardless of the contents of register 0. The USING domain for this automatic base register assignment is the entire source module. | If a register is specified with base address zero, the assembler will use it in | preference to the default use of register zero. For example: | USING 3, | LA 7,5 | generates the instruction X'41703005'; in the absence of the USING statement, the | generated instruction would be X'41700005'. For absolute implicit addresses greater than 4095 and in the absence of long-displacement instructions, a USING instruction must be specified according to the following: With a base address representing an absolute expression With a base register that has not been assigned by a USING instruction in which a relocatable base address is specified This base register must be loaded with the base address specified. Ordinary USING Instruction The ordinary USING instruction format specifies a base address and one or more base registers. Ordinary USING ►►──┬─────────────────┬──USING──┬─base─────────────┬────────────────► └─sequence_symbol─┘ └─(base─┬────── ┬─) ─┘ └─,end─┘ ┌ ──────────────┐ ►─── ▼ ,base_register┴────────────────────────────────────────────────►◄ sequence_symbol is a sequence symbol. base specifies a base address, which can be a relocatable or an absolute expression. The value of the expression must lie between 0 and 2 31 −1. 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 220 HLASM V1R5 Language Reference

USING Instruction end address must be greater than the base and must have the same relocatability attributes. The resolvable range of a USING with an 'end' operand is base,MIN(495,end-1) Thus USING base,reg is equivalent to USING (base,base+496),reg. base_register is an absolute expression whose value represents general registers 0 through 15. The default range is 4096 per base register. The assembler assumes that the base register denoted by the first base_register operand contains the base address base at execution time. If present, the subsequent base_register operands represent registers that the assembler assumes contain the address values base+4096, base+8192, and so forth. For example: USING BASE,9,1,11 has the logical equivalent of: USING BASE,9 USING BASE+496,1 USING BASE+8192,11 In another example, the following statement: USING ,12,13 tells the assembler to assume that the current value of the location counter is in general register 12 at execution time, and that the current value of the location counter, incremented by 4096, is in general register 13 at execution time. Computing Displacement: If you change the value in a base register being used, and want the assembler to compute displacements from this value, you must tell the assembler the new value by means of another USING statement. In the following sequence, the assembler first assumes that the value of ALPHA is in register 9. The second statement then causes the assembler to assume that ALPHA+1 is the value in register 9. USING ALPHA,9 . . USING ALPHA+1,9 Using General Register Zero: You can refer to the first 4096 bytes of storage using general register 0, subject to the following conditions: The value of operand base must be either absolute or relocatable zero. Register 0 must be specified as the first base_register operand. The assembler assumes that register 0 contains zero. Therefore, regardless of the value of operand base, it calculates displacements as if operand base were absolute or relocatable zero. The assembler also assumes that subsequent registers specified in the same USING statement contain 4096, 8192, etc. Chapter 5. Assembler Instruction Statements 221

USING Instruction<br />

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

relocatability attributes.<br />

The resolvable range of a USING with an 'end' operand is<br />

base,MIN(495,end-1)<br />

Thus USING base,reg is equivalent to USING (base,base+496),reg.<br />

base_register<br />

is an absolute expression whose value represents general registers 0 through<br />

15.<br />

The default range is 4096 per base register.<br />

The assembler assumes that the base register denoted by the first base_register<br />

operand contains the base address base at execution time. If present, the<br />

subsequent base_register operands represent registers that the assembler<br />

assumes contain the address values base+4096, base+8192, and so forth.<br />

For example:<br />

USING<br />

BASE,9,1,11<br />

has the logical equivalent of:<br />

USING<br />

BASE,9<br />

USING<br />

BASE+496,1<br />

USING<br />

BASE+8192,11<br />

In another example, the following statement:<br />

USING<br />

,12,13<br />

tells the assembler to assume that the current value of the location counter is in<br />

general register 12 at execution time, and that the current value of the location<br />

counter, incremented by 4096, is in general register 13 at execution time.<br />

Computing Displacement: If you change the value in a base register being used,<br />

and want the assembler to compute displacements from this value, you must tell<br />

the assembler the new value by means of another USING statement. In the<br />

following sequence, the assembler first assumes that the value of ALPHA is in<br />

register 9. The second statement then causes the assembler to assume that<br />

ALPHA+1 is the value in register 9.<br />

USING<br />

ALPHA,9<br />

.<br />

.<br />

USING<br />

ALPHA+1,9<br />

Using General Register Zero: You can refer to the first 4096 bytes of storage<br />

using general register 0, subject to the following conditions:<br />

The value of operand base must be either absolute or relocatable zero.<br />

Register 0 must be specified as the first base_register operand.<br />

The assembler assumes that register 0 contains zero. Therefore, regardless of the<br />

value of operand base, it calculates displacements as if operand base were<br />

absolute or relocatable zero. The assembler also assumes that subsequent<br />

registers specified in the same USING statement contain 4096, 8192, etc.<br />

Chapter 5. Assembler Instruction Statements 221

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

Saved successfully!

Ooh no, something went wrong!