Hmm…I think you get the gist of my question, but are answering the reverse problem…I'm not being called with my parm in R1. I would like to make a call and have the parameter placed into R1 (rather than a pointer to a standard parameter list). Is there a way to do that?
I've cobbled together this __asm which probably does the right thing (also gobbles up R15 as the Return Code and R0 as the Reason Code):
#define CallwithR1(ParmPtr,RoutinePtr,RC,Rsn) \
__asm( \
" L R1,%2 Get ParmPtr into R1 \n" \
" L R15,%3 Get RoutinePtr into R15 \n" \
" BASR R14,R15 Call the routine \n" \
" ST R15,%0 Save the return code \n" \
" ST R0,%1 Save the reason code \n" \
/* Output variables */ \
: "=m"(RC) /* %0, output only, in-memory */ \
,"=m"(Rsn) /* %1, output only, in memory */ \
/* Input variables */ \
: "m"(ParmPtr) /* %2, input, in-memory */ \
,"m"(RoutinePtr) /* %3, input, in-memory */ \
/* Register clobber list */ \
: "r0" /* R0 clobbered by reason code */ \
,"r1" /* R1 clobbered by linkage code */ \
,"r14" /* R14 clobbered by return addr */ \
,"r15" /* R15 clobbered by return code */ \
Then I could "CallwithR1(&myparm,&myroutine,RetCode,RsnCode)"
I was just hoping that I'd not have to go down this route…
Thanks!
Scott
Scott Fagen