On Sun, Feb 15, 2015 at 9:46 AM, [email protected] <[email protected]> wrote:

> I stumbled across a small routine whose function is to issue a STIMER and
> return to the caler, when the Time Limit Expires. What I found interesting
> was the way this routine saved the return code.
> .
> .
> STIMER WAIT,DINTVL=WAITTIME    .Wait till the end
> L    R13,SAVE+4                .Return to caller
> ST   R15,16(,R13)      <===HERE
> LM   R14,12,12(R13)
> BR   R14
> .
> .
> Before restoring the callers registers, Register 15
> is stored in the Register 15 Slot of the Callers Save Area.
> OR that is how it appears to me.
> .
> Has Anyone seen this technique ?
>

​Yes.


> Any comments on using this technique ?
>

​FWIW, _I_ do it quite often. It is kind of like setting RETURN-CODE In
COBOL somewhere deep in the logic and it just "pops" out when the
subroutine (or program) ends. It is really nice for a reentrant routine
because you don't need to maintain a "return code" variable field or
dedicate a register to it. You might even set the slot value somewhere else
in the code not even close to where the program ends. Of course, if this
later is done, it better be _well_ documented what is going on or the
maintenance programmer is likely to be after the original "clever" coder
with a meat clever. No, I do _not_ believe that any language is "self
documenting" unless it is something like Knuth's "literate programming"
where the program code is actually embedded in the documentation, exists
only in the documentation, and is extracted from the documentation for
compilation purposes.​ Which makes me wonder when the next language
designer will merge "literate programming" with "semantic documents" and we
reach a place of enlightenment. Or am I sleep deprived again?



> .
> .
> Just curious
>
> Paul
> ****
>



-- 
He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

Reply via email to