It's also worth a look at the redbook (quite old) http://www.redbooks.ibm.com/abstracts/sg245991.html. XPLINK uses page protection to trap overlays to trigger stack frame extension. Rather clever idea and it removed several instructions from C/C++ prolog code.

On 20/08/2014 5:43 PM, Leopold Strauss wrote:
Look at 'zOS Language Environment Vendor Interfaces'.

On 20.08.2014 11:35, Hardee, Chuck wrote:
David,

You say that the subroutine linkage is different. Can you tell me where the linkage is documented? I'd like to understand how XPLINK linkage works for incorporation into some of my routines.

Thanks,
Chuck

Charles (Chuck) Hardee
Senior Systems Engineer/Database Administration
CCG Information Technology

Thermo Fisher Scientific
300 Industry Drive | Pittsburgh, PA 15275
Phone +1 (724) 517-2633 | Mobile +1 (412) 877-2809 | FAX: +1 (412) 490-9230
[email protected] | www.thermofisher.com

WORLDWIDE CONFIDENTIALITY NOTE: Dissemination, distribution or copying of this e-mail or the information herein by anyone other than the intended recipient, or an employee or agent of a system responsible for delivering the message to the intended recipient, is prohibited. If you are not the intended recipient, please inform the sender and delete all copies.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of David Crayford
Sent: Tuesday, August 19, 2014 11:19 PM
To: [email protected]
Subject: Re: ASM calling C or C++ subroutines

That looks good to me. Make sure that you setup the parameter lists
correctly. C/C++ are call by value languages. The code path for calling
a routine is just a few instructions. It loads LE control blocks into
registers and then uses BSM to invoke the routine.

You certainly will need LE if your calling C/C++ code other than Metal/C.

You only need XPLINK if your C/C++ programs are compiled XPLINK. I
always use XPLINK because it almost always generates faster code but the
subroutine linkage is very different to OS linkage and you have to take
that into consideration when debugging.

On 20/08/2014 4:28 AM, Donald Likens wrote:
I have been looking at the LE documentation now for days and still not sure what I need to do to have my Assembler program call C or C++ programs. I need this interface to be very efficient because I will be calling these subroutines maybe more than a 1,000,000 times a day. What I have come up with is to use CEEPIPI to build the environment.

           LA    R5,PPTBL           GET ADDRESS OF PIPI TABLE
           ST    R5,@CEXPTBL        CEEXPTBL-ADDR -> PIPI TABLE
           L     R15,PPRTNPTR       GET ADDRESS OF CEEPIPI ROUTINE
*                                 INVOKE CEEPIPI ROUTINE
           CALL (15),(INITSUB,@CEXPTBL,@SRVRTNS,RUNTMOPT,TOKEN)

I will have three subroutines so I think I need to put each one of these routines in the preinit table.

Now I think I need to use CEEPIPI again when I want to call each subroutine.

           ST    R11,PARM
           L     R15,PPRTNPTR       GET ADDRESS OF CEEPIPI ROUTINE
CALL (15),(CALLSUB,PTBINDEX,TOKEN,PARM, X
                 SUBRETC,SUBRSNC,SUBFBC)   INVOKE CEEPIPI ROUTINE

Note:
Note: The C routines have not been created yet, so I can't try these things out.

Questions:
1) Do I have it correct?
2) Do I even need LE?
3) The book talks about XPLINK. I don't quite understand it. Is this something I should explore more?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to