There is a potentially meaningful performance hit only if the load module / 
program object is marked refreshable.  For the non-refreshable case, the 
one--time performance hist (the first time ST R15,PTR is executed) is trivial 
compared to the potential cost of getting the called program address.

Don't mark such code refreshable and you will be fine.

This is an old, old technique used in probably thousands or more of "dynamic 
call" assembler stub programs.  Yes there are modern, reentrant and refreshable 
techniques now - name/token pair comes to mind - but they are not without their 
own cost in CPU time.

I wouldn't call the technique ugly, just necessary and (relatively) efficient.

If it ain't broke, don't fix it.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Seymour J Metz
Sent: Monday, February 8, 2021 1:04 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: LINK vs LOAD/CALL

EXTERNAL EMAIL

My original code had the DC after everything else. But if the DC is too close 
to the code, then there will be a performance hit. Even if not, it's ugly. Not 
everything that is possible is desirable.

--

________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Gibney, Dave [gib...@wsu.edu]
Sent: Monday, February 8, 2021 12:38 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: LINK vs LOAD/CALL

Would
> This is refreshable, and even runs on S/360

          PTR      DC    A(0)
label L     R15,PTR
          LTR   R15,R15
          BNZ   CALLIT
          ...        ...                                    Code that always 
leaves the same value in R15
          ST    R15,PTR
 CALLIT   BALR  R14,R15

Still incur cache flush?

> -----Original Message-----
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On 
> Behalf Of Seymour J Metz
> Sent: Sunday, February 07, 2021 6:38 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: LINK vs LOAD/CALL
>
> This is refreshable, and even runs on S/360
>
>          L     R15,PTR
>          LTR   R15,R15
>          BNZ   CALLIT
>          ...        ...                                    Code that always 
> leaves the same value in R15
>          ST    R15,PTR
> CALLIT   BALR  R14,R15
>          ...
> PTR      DC    A(0)
>
> This is reentrant, and requires at least S/370
>
> RETRY    L     R1,COUNTER
>          LA    R0,1(,R1)
>          CS    R1,,R0,COUNTER
>          BNE   RETRY
>          ...
> COUNTER  DC    F'0'
>
> I would consider either to be bad form.
--

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.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to