When i read the book the format to establish the addressability is using following code :
And book siad BALR is used to actually write the address into R12 at run time. But when i read the following exit code , i got two questions.
1. In this code , it not use BALR ,how to put address in R12 at run time ?
2. Why it use two USING here ? get two different address for base address? why?
TMSXITC CSECT ,
TMSXITC AMODE 31
TMSXITC RMODE ANY
LR R8,R1 PARAMETER LIST
USING UX0CPARM,R8 ADDRESSABILITY
LM R9,R11,UX0CPARM LOAD ALL PARAMETERS
USING TMRECST,R10 ADDRESSABILITY
LTR R11,R11 Q. IS THIS A MULTI-VOLUME
BNZ MULTIVOL A. YES, COPY ONLY CERTAIN ELDS
Joined: 30 Nov 2013 Posts: 845 Location: The Universe
Actually, there are at least 3 base registers -
R12, established by the TMMLINK macro, to provide addressability for the exit. The address in R12 is established by the TMMLINK macro. There are - usually - two ways to initialize a base register for a program.
Use the module's address. The convention in all operating systems derived from OS/360 is that register 15 contains the address of the module when it is entered, so you see something like this -
Some expansions of the SAVE macro, by the way, and including the one used here, assume register 15 contains the address of the first instruction of the SAVE macro.
If you are unwilling to trust the common rule, you store the address yourself -
You can determine the convention used by TMMLINK by reviewing its expansion
R8, to provide addressability to the parameter list built by the exit's caller. In turn, the data in R8 was copied from R1. At a guess the module that called TMSXITC stored the address in R1.
R10, to provide addressability to a data area defined by the TMRECST DSECT. Its address is in the parameter list.