I wrote Spice up a C program by using __asm__ to include inline assembler. <https://colinpaice.blog/2022/07/05/spice-up-a-c-program-by-using-__asm__-to-include-inline-assembler/> But this whole area seems not very well documented You could save register 0 in a variable with the assembler code Colin
On Thu, 27 Oct 2022 at 18:14, Charles Mills <charl...@mcn.org> 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: > > 1. Where is it documented? As I say, I use it and it works, but I don't > recall how I learned about it, and wondered if and where it was documented. > > 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? > > 3.Any other cool stuff available from __gtab()? > > Thanks, > Charles > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN