HLASM Language Reference
HLASM Language Reference HLASM Language Reference
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
- Page 190 and 191: DC Instruction—Binary Floating-Po
- Page 192 and 193: DROP Instruction DROP Instruction T
- Page 194 and 195: DS Instruction USING DSECTA,14 ALBL
- Page 196 and 197: DS Instruction The size of a storag
- Page 198 and 199: DSECT Instruction DSECT Instruction
- Page 200 and 201: DXD Instruction ASEMBLY2 CSECT USIN
- Page 202 and 203: END Instruction change but no addit
- Page 204 and 205: EQU Instruction EQU Instruction The
- Page 206 and 207: EQU Instruction 5. The length attri
- Page 208 and 209: EXITCTL Instruction sequence_symbol
- Page 210 and 211: ISEQ Instruction must be greater th
- Page 212 and 213: LOCTR Instruction A CSECT , See not
- Page 214 and 215: LTORG Instruction If symbol is an o
- Page 216 and 217: MNOTE Instruction When two literals
- Page 218 and 219: OPSYN Instruction ,ERROR, SEV 1 An
- Page 220 and 221: ORG Instruction AFTER is defined in
- Page 222 and 223: ORG Instruction If you specify mult
- Page 224 and 225: POP Instruction POP Instruction The
- Page 226 and 227: PRINT Instruction Note: If the next
- Page 228 and 229: Process Statement Process Statement
- Page 230 and 231: REPRO Instruction NOPRINT instructs
- Page 232 and 233: RSECT Instruction 4. AMODE or RMODE
- Page 234 and 235: START Instruction START Instruction
- Page 236 and 237: TITLE Instruction The name value is
- Page 238 and 239: USING Instruction Only the characte
- Page 242 and 243: USING Instruction If register 0 is
- Page 244 and 245: USING Instruction A variable symbo
- Page 246 and 247: USING Instruction In this MVC instr
- Page 248 and 249: USING Instruction Range of a Depend
- Page 250 and 251: XATTR Instruction external_symbol i
- Page 252 and 253: XATTR Instruction SCOPE ►►─
- Page 254 and 255: XATTR Instruction 234 HLASM V1R5 La
- Page 256 and 257: Part 3. Macro Language &SYSDATC Sys
- Page 258 and 259: Introduction to Macro Language Chap
- Page 260 and 261: Introduction to Macro Language The
- Page 262 and 263: Introduction to Macro Language Macr
- Page 264 and 265: MACRO and MEND Statements The assem
- Page 266 and 267: Prototype Statement Macros that are
- Page 268 and 269: Model Statements generated from tha
- Page 270 and 271: Model Statements ▌5▐ ▌6▐
- Page 272 and 273: Model Statements Notes: 1. You can
- Page 274 and 275: Positional Parameters Symbolic para
- Page 276 and 277: Processing Statements Processing St
- Page 278 and 279: AREAD Instruction Assign Local Time
- Page 280 and 281: COPY Instruction sequence_symbol is
- Page 282 and 283: System Variable Symbols System Vari
- Page 284 and 285: &SYSADATA_MEMBER System Variable Sy
- Page 286 and 287: &SYSCLOCK System Variable Symbol &S
- Page 288 and 289: &SYSECT System Variable Symbol depe
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