Oops, Tony is correct – you can use LARL even if the exit labels are outside of 
the mainline USING I suggested.

That’s a much better solution than my adcon suggestion.  If you decide to use 
my USING suggestions then change your LA’s to LARL’s for the exit addresses.

Peter

From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> On Behalf 
Of Tony Harminc
Sent: Wednesday, November 8, 2023 5:25 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Internal Exit Routine Handling


On Wed, 8 Nov 2023 at 17:13, Farley, Peter <

00000dc9d8785c29-dmarc-requ...@listserv.uga.edu> wrote:



> 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”.

>



In the case where the routines are in the same assembly/CSECT, but don't

have addressibility via a register, LARL is your friend. For that matter

LARL is generally useful in all sorts of such cases. For example, where you

have a main routine and some sort of exits or callbacks that don't get

passed the original base register value, in old-style coding you might need

something like:

BALR  Rx,EXIT

USING EXIT,Rx

L     Rn,=A(MAIN)

USING MAIN,Rn



to establish a base. Now you can use



LARL Rn,MAIN

USING MAIN,Rn

to get the main base back.



Tony H.

--

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