In this particular case, why not allow the mainline to have full addressabilty 
and drop the base at the point where it's no longer valid?


-- 
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי



________________________________________
From: IBM Mainframe Assembler List <[email protected]> on behalf 
of Farley, Peter <[email protected]>
Sent: Wednesday, November 8, 2023 5:13 PM
To: [email protected]
Subject: Re: Internal Exit Routine Handling

The “why” of using adcons instead of direct instruction reference with my 
suggested USING setup:

Because the mainline USING that I suggested limits the use of R11 to just the 
mainline code and data, the labels on your exit routines are not addressable 
using R11 since they are outside of that range of addresses.

Loading an A(exitname) constant means the assembler can resolve the adcon value 
to “offset from start of code” because it knows where that name is in the 
object code, but it won’t let you use that name directly in LA or LAY because 
there is no base register that covers the area where the exit name is coded.  
Then the loader can fully resolve the adcon value at program load time because 
the ESD entry is “CSECT start + offset”.

Peter

From: IBM Mainframe Assembler List <[email protected]> On Behalf 
Of Dave Clark
Sent: Wednesday, November 8, 2023 4:49 PM
To: [email protected]
Subject: Re: Internal Exit Routine Handling


"IBM Mainframe Assembler List" <[email protected]> wrote on

11/08/2023 04:31:21 PM:

> If in the mainline code you need the address of any exit routine,

> use “L Rx,=A(exit name)” rather than simply “LA Rx,exitname”.





        I get the rest of what you said.  But could you explain why the

above is needed?  It seems related to using a V address constant for an

external subroutine which is resolved by the linkage editor.  To start

with, I guess that this is because of limiting the range of the code base?

 Does the linkage editor still get involved in adjusting the =A constant

after the fact?



        I do have the following in the mainline code when I set up to call

to the IBM system utility.  Obviously, I could simply change this as you

describe but I wouldn't know why -- and I always like to know why.   ;-)



LA    R2,IPTEXIT              GET EXIT RTN ADDRESS

LA    R3,IPTAREA              GET I/O AREA ADDRESS

STM   R2,R3,INLCIPTA          PUT ADDRESSES IN CONTROL BLOCK

LA    R2,LSTEXIT              GET EXIT RTN ADDRESS

LA    R3,LSTAREA              GET I/O AREA ADDRESS

STM   R2,R3,INLCLSTA          PUT ADDRESSES IN CONTROL BLOCK

LA    R2,PCHEXIT              GET EXIT RTN ADDRESS

LA    R3,PCHAREA              GET I/O AREA ADDRESS

STM   R2,R3,INLCPCHA          PUT ADDRESSES IN CONTROL BLOCK





Sincerely,



Dave Clark

--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

Reply via email to