HLASM Language Reference
HLASM Language Reference HLASM Language Reference
USING Instruction A variable symbol that has been assigned a character string with a value that is valid for an ordinary 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 end address must be greater than the base and must have the same relocatability attributes. base_register is an absolute expression whose value represents general registers 0 through 15. The default range is 4096 per base register. The essential difference between a labeled USING instruction and an ordinary USING instruction is the label placed on the USING statement. To indicate to the assembler that the USING established with the label is to provide resolution of base and displacement for a symbol, the label must be used to qualify the symbol. Qualifying a symbol consists of preceding the symbol with the label on the USING followed by a period. The only symbols resolved by the labeled USING are those symbols qualified with the label. This label cannot be used for any other purpose in the program, except possibly as a label on other USING instructions. The following examples show how labeled USINGs are used: PRIOR USING IHADCB,R1 NEXT USING IHADCB,R2 MVC PRIOR.DCBLRECL,NEXT.DCBLRECL The same code without labeled USINGs could be written like this: USING IHADCB,R1 MVC DCBLRECL,DCBLRECL-IHADCB(R2) In the following example, a new element, NEW, is inserted into a doubly-linked list between two existing elements LEFT and RIGHT, where the links are stored as pointers LPTR and RPTR: 224 HLASM V1R5 Language Reference
USING Instruction LEFT USING ELEMENT,R3 RIGHT USING ELEMENT,R6 NEW USING ELEMENT,R1 . . MVC NEW.RPTR,LEFT.RPTR Move previous Right pointer MVC NEW.LPTR,RIGHT.LPTR Move previous Left pointer ST R1,LEFT.RPTR Chain new element from Left ST R1,RIGHT.LPTR Chain new element from Right . . ELEMENT DSECT LPTR DS A Link to left element RPTR DS A Link to right element . . Range of a Labeled USING Instruction The range of a labeled USING instruction (called the labeled USING range) is the 4096 bytes beginning at the base address specified in the labeled USING instruction, or the range as specified by the range end, whichever is the lesser. Addresses that lie within the labeled USING range can be converted from their implicit form (qualified symbols) to their explicit form; those outside the USING range cannot be converted. Like the ordinary USING range, the labeled USING range is the range of addresses in a control section that is associated with the base register specified in the labeled USING instruction. If the labeled USING instruction assigns more than one base register, the composite labeled USING range is the product of the number of registers specified in the labeled USING instruction and 4096 bytes. The composite labeled USING range begins at the base address specified in the labeled USING instruction. Unlike the ordinary USING range, however, you cannot specify separate labeled USING instructions to establish the same labeled USING | range. For example, | IN USING BASE,1,11 | specifies a range of 8192 bytes beginning at BASE, but | IN USING BASE,1 | IN USING BASE+496,11 | specifies a single labeled USING range of 4096 bytes beginning at BASE+4096. You can specify the same base address in any number of labeled USING instructions. You can also specify the same base address in an ordinary USING and a labeled USING. However, unlike ordinary USING instructions that have the same base address, if you specify the same base address in an ordinary USING instruction and a labeled USING instruction, High Level Assembler does not treat the USING ranges as coinciding. When you specify an unqualified symbol in an assembler instruction, the base register specified in the ordinary USING is used by the assembler to resolve the address into base-displacement form. An example of coexistent ordinary USINGs and labeled USINGs is given below: USING IHADCB,R1 SAMPLE USING IHADCB,R2 MVC DCBLRECL,SAMPLE.DCBLRECL Chapter 5. Assembler Instruction Statements 225
- 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 240 and 241: USING Instruction Base Registers fo
- Page 242 and 243: USING Instruction If register 0 is
- 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
- Page 290 and 291: &SYSIN_MEMBER System Variable Symbo
- Page 292 and 293: &SYSJOB System Variable Symbol &SYS
USING Instruction<br />
A variable symbol that has been assigned a character string with a value<br />
that is valid for an ordinary symbol<br />
base<br />
specifies a base address, which can be a relocatable or an absolute<br />
expression. The value of the expression must lie between 0 and 2 31 −1.<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 />
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 essential difference between a labeled USING instruction and an ordinary<br />
USING instruction is the label placed on the USING statement. To indicate to the<br />
assembler that the USING established with the label is to provide resolution of base<br />
and displacement for a symbol, the label must be used to qualify the symbol.<br />
Qualifying a symbol consists of preceding the symbol with the label on the USING<br />
followed by a period. The only symbols resolved by the labeled USING are those<br />
symbols qualified with the label. This label cannot be used for any other purpose in<br />
the program, except possibly as a label on other USING instructions.<br />
The following examples show how labeled USINGs are used:<br />
PRIOR USING IHADCB,R1<br />
NEXT USING IHADCB,R2<br />
MVC PRIOR.DCBLRECL,NEXT.DCBLRECL<br />
The same code without labeled USINGs could be written like this:<br />
USING IHADCB,R1<br />
MVC DCBLRECL,DCBLRECL-IHADCB(R2)<br />
In the following example, a new element, NEW, is inserted into a doubly-linked list<br />
between two existing elements LEFT and RIGHT, where the links are stored as<br />
pointers LPTR and RPTR:<br />
224 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>