On 2015-02-16, at 05:32, [email protected] wrote:
> 
> Can you imagine my surprise, when I found code (in an untouched
> subroutine) that relied on some register in the MIDDLE of the routine
> (3500 lines of code) to be the same as it was, when the calling routine
> was left. I had to use PER SLIP Storage alteration to find that tiny
> little bug/instruction.
> 
What would be better?

o Reloading that register from the RSA immediately before such use?

o Mapping the RSA with a DSECT that places an identifier where that
 register was saved.

o Copying that register to working storage on entry, then reloading
 it before use.

Of course, if someone overwrote that register in the RSA, it's a
calling sequence violation regardless how it's used.

Some programmers choose to append working storage to the RSA and
use R13 for both, saving a base register and a GETMAIN.  Other
programmers deplore this technique.  It might be safer if only
USING provided for a lower bound on the range as well as an
upper bound.

-- gil

Reply via email to