On Thu, Oct 27, 2022 at 12:14:19PM -0500, Charles Mills wrote:
> XLC defines a macro __R1 in stdlib.h. It is the contents of GPR 1 on
> entry to the program. Looking at stdlib, it is #defined as __gtab(12)
> -- or there may be further #defines farther back -- that is as far as I
> have researched. I am guessing __gtab() is a magically-defined internal
> function. I use __R1 and I am totally under control on it, but I have
> some questions:

> 2. Is there any equivalent way to get the contents of GPR 0 (short of
> writing an assembler front-end, which is a small PITA of its own)? Why? So
> a routine called from Rexx could get the Environment Block address. Or
> does anyone have another good way of getting that?

Wild guess:  __gtab(8) might get you the contents of the R0 from the caller.

This assumes __gtab(offset) retuns the value from a standard old 72 byte
save area save area and the parm is the offset from the r14 slot..

So the callers registers would be stored in order R14 through R12 starting
at __gtab(0)

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