An XL C/C++ may or may not have a DSA address in R13. If it is XPLINK, it will not. 64-bit C/C++ programs always use XPLINK-64 linkage. In fact, 64-bit LE programs only use XPLINK-64 linkage.
-- Tom Marchant On Wed, 15 Nov 2023 17:54:44 +0000, Farley, Peter <[email protected]> wrote: >Isn’t there is some C library function (maybe unique to XLC/C++) that lets you >get the value of R13 (current DSA pointer)? With that pointer value in hand, >couldn’t one chain up the DSA stack to get to the saved registers at entry, or >is that not possible? > >At worst, an inline ASM routine to copy the value of the current R13 to a C >pointer variable, then chain up the DSA stack? > >Peter > >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Charles Mills >Sent: Wednesday, November 15, 2023 12:39 PM >To: [email protected] >Subject: Re: External Functions in C on z/OS > > >I see, in my C++ projects, EFPL, ENVB, EVALB and SHVB structs that appear to >me to have been produced from IBM macros by the EDCDSECT tool. > > > >Have you looked for the IRX macros in SYS1.MACLIB? > > > >Are you familiar with EDCDSECT? > > > >Slightly changing the subject, to interface with ehe Rexx environment from a >called function you will need the entry R0, I found no great way to get that. >I had to write a tiny front end in assembler that passes R0 to a C/C++ main(). > > > >Charles > > > >On Wed, 15 Nov 20 3 10:57:14 -0600, Eric Erickson <[email protected]> >wrote: > > > >>I've written quite a few callable external funitions for Rexx over the years. >>On z/OS I've always used assembler as we needed to access system services for >>a variety of tasks. I've written them in C for other platforms (OS/2 & >>Windows) over the years. I need to write some on z/OS, but I want to use C, >>but can not seem to find any examples or header files for the Rexx Control >>Blocks. I can't believe nobody has done this over the years? Is it even >>supported? > > > >-- > >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 [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
