USING command
Assembler |
Description
The USING command establishes addressability to a DSECT. The command is effective only if the following requirements are met:
- The application program has already established a base register for the referenced DSECT.
- The program has loaded the base register with the appropriate value.
A record of the command is written to the session log.
Input
The following are the parameter descriptions for the USING command:
dsect-name
The name of a DSECT, a DSECT item, or a variable qualified by a label from a labeled USING statement.
location
A specified place where dsect-name is to start. Valid locations are address, data-name, or data-name + offset. If location is an address, a value of 0 cannot be used.
Rn
The general-purpose register that contains the address used to establish addressability to the specified DSECT. Valid values are R0 through R15.
Usage Notes
- Several USING commands can be issued in an Code Debug TSO test session. There is no maximum number.
- To reassign a dropped register as the base register, enter the DROP command or reissue the USING command. See DROP for a description of the DROP command.
- This command is primarily used in connection with the GETMAIN command. A work area must be allocated first. See GETMAIN.
Examples
Examples of valid forms of the USING command are:
- With a DSECT label, enter:
USING MYDSECT R11 - With an address, enter:
USING MYDSECT B77418 - With a labeled USING, enter:
USING ALABL.BITEM R4 - With an address-expression, enter:
USING BITEM CITEM+5 The following figure shows an example of entering a USING command. Prior to this, R6 was loaded with the appropriate address. The Keep window was expanded with the SET command to show all the explicit and automatic keeps.
Entering the USING Command------------------------ CODE DEBUG TSO - SOURCE ------------------------------
COMMAND ===> using tstrec r6; memory R6% SCROLL ===> CSR
PROGRAM: TRITSTA MODULE: TRITSTA COMP DATE: 07/20/1997 COMP TIME: 14:41:00
000000 K TSTREC DSECT > 0
000000 K TYPE DS ZL1 > 0 ZONED
000001 K DS 0CL3 > 345
000001 K SIDEA DS ZL1 > 3 ZONED
000002 K SIDEB DS ZL1 > 4 ZONED
000003 K SIDEC DS ZL1 > 5 ZONED
ANB DS PL2 > +0 PACKED
------ --------------------------------------- Before TRITSTA:67670/AMODE 24 <>
06766C START EQU *
06766C L R2,0(R1) POINT R2 TO PARAMETER
------ USING TSTREC,R2 SET ADDRESS FOR DSECT
=====> ZEROIT ZAP ANB,=P’0’
067676 ZAP ANC,=P’0’
06767C ZAP BNC,=P’0’
067682 PACKIT PACK TSTA,SIDEA PACK TRIANGLE SIDE
067688 PACK TSTB,SIDEB "
GPREGS R0 ==> 00000001 R1 ==> 000671C8 R2 ==> 00067301 R3 ==> 0006CC30
R4 ==> 02944B10 R5 ==> 00057850 R6 ==> 00067309 R7 ==> 80090E56
R8 ==> 0009F144 R9 ==> 00000000 R10 ==> 00090FBC R11 ==> 00067750
R12 ==> 00067658 R13 ==> 00067750 R14 ==> 00097AC4 R15 ==> 00067658The following figure shows the memory display for register 6 at location 67309 as a result of the commands entered in Entering the USING Command.
Displaying Memory at the Reassigned Address------------------------ CODE DEBUG TSO - MEMORY ------------------------------
COMMAND ===> end SCROLL ===> CSR
PROGRAM: TRITSTA MODULE: TRITSTA COMP DATE: 07/20/1997 COMP TIME: 14:41:00
------------------------------------------------ Before TRITSTA:67670/AMODE 24 --
0 - 2 - 4 - 6 - 8 - A - C - E - = 0-2-4-6-8-A-C-E-
******************************************************************************
067309 ===> F0F5F5F5 40404040 40404040 40404040 = 0555
067319 ===> 40404040 40404040 40404040 40404040 =
067329 ===> 40404040 40404040 40404040 40404040 =
067339 ===> 40404040 40404040 40404040 40404040 =
067349 ===> 40F0F0F0 F1F0F0F0 F0000000 0000000C = 00010000.......
067359 ===> 1C000000 00000090 ECD00C18 CF41B0C0 = ................
067369 ===> D850DB00 0450BD00 0818DB58 21000018 = 0...............
067379 ===> 624130C1 F1415000 04070045 10C02C8F = ...A1...........
067389 ===> 0674800A 134110C1 204100C1 8058F010 = .......A...A..0.
067399 ===> 3005EF41 10C12041 00C1A158 F0103005 = .....A...A..0...
0673A9 ===> EFD203C2 C2C2E8DE 03C2C220 00D220C2 = .K.BBBY..BB..K.B
0673B9 ===> A1300041 10C12041 00C29658 F0103005 = .....A...B..0...
0673C9 ===> EF412020 02413030 21D203C2 C2C2F046 = .........K.BBB0.
0673D9 ===> 50C04A41 10C12041 00C1A158 F0103005 = .....A...A..0...
GPREGS R0 ==> 00000001 R1 ==> 000671C8 R2 ==> 00067301 R3 ==> 0006CC30
R4 ==> 02944B10 R5 ==> 00057850 R6 ==> 00067309 R7 ==> 80090E56
R8 ==> 0009F144 R9 ==> 00000000 R10 ==> 00090FBC R11 ==> 00067750
R12 ==> 00067658 R13 ==> 00067750 R14 ==> 00097AC4 R15 ==> 00067658The following figure shows that the address to a DSECT has been reassigned.
Reassigning Address to TSTREC------------------------ CODE DEBUG TSO - SOURCE ------------------------------
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRITSTA MODULE: TRITSTA COMP DATE: 07/20/1997 COMP TIME: 14:41:00
000000 TSTREC DSECT > 0
000000 TYPE DS ZL1 > 0 ZONED
000001 DS 0CL3 > 555
000001 SIDEA DS ZL1 > 5 ZONED
000002 SIDEB DS ZL1 > 5 ZONED
000003 SIDEC DS ZL1 > 5 ZONED
ANB DS PL2 > +3 PACKED
------ --------------------------------------- Before TRITSTA:67670/AMODE 24 <>
06766C START EQU *
06766C L R2,0(R1) POINT R2 TO PARAMETER
------ USING TSTREC,R2 SET ADDRESS FOR DSECT
=====> ZEROIT ZAP ANB,=P’0’
067676 ZAP ANC,=P’0’
06767C ZAP BNC,=P’0’
067682 PACKIT PACK TSTA,SIDEA PACK TRIANGLE SIDE
067688 PACK TSTB,SIDEB "
GPREGS R0 ==> 00000001 R1 ==> 000671C8 R2 ==> 00067301 R3 ==> 0006CC30
R4 ==> 02944B10 R5 ==> 00057850 R6 ==> 00067309 R7 ==> 80090E56
R8 ==> 0009F144 R9 ==> 00000000 R10 ==> 00090FBC R11 ==> 00067750
R12 ==> 00067658 R13 ==> 00067750 R14 ==> 00097AC4 R15 ==> 00067658- For an example of labeled dependent USING instructions in a High-Level Assembler program, see Keeping Labeled Dependent USINGs.