Optimizing a tail CALL?

2011-01-20 Thread McKown, John
I'm wondering if the following is a good idea. I've been reading again. If I have a routine which does the following: ... CALL MYSUB,(PARMS,...),VL L R13,4(,R13) RETURN (14,12),T,RC=(15) and I'm using standard calling conventions and save areas, is there any

Re: Optimizing a tail CALL?

2011-01-20 Thread Chris Craddock
I'm wondering if the following is a good idea. I've been reading again. If I have a routine which does the following: ... CALL MYSUB,(PARMS,...),VL L R13,4(,R13) RETURN (14,12),T,RC=(15) and I'm using standard calling conventions and save areas, is

Re: Optimizing a tail CALL?

2011-01-20 Thread David P de Jongh
Bad idea if MYSUB abends. You've effectively lost the evidence that would have been in the back chain. Also, if you're in an LE environment, you have the danger that something your program is passing will be walked on by MYSUB, because you are now giving MYSUB your program's DSA to do with as he

Re: Optimizing a tail CALL?

2011-01-20 Thread Chris Craddock
One questions how there would be addressability to either the VCON or the parms. You're right of course. I wasn't bothering with the details. If it were me and I wanted to do it this way, I'd get the parmlist address (R1) and branch address (R15) set up inline and then restore R2-R14 and

Re: Optimizing a tail CALL?

2011-01-20 Thread Paul Gilmartin
On Jan 20, 2011, at 11:57, McKown, John wrote: ... LR13,4(,R13) LM R14,R12,12(R13) CALL MYSUB,(PARAMS,...),LINKOP='15,15',LINKINST=BCR,VL The above call replaces the normal BALR 14,15 with BCR 15,15 and so goes to MYSUB, but removes the current program