Hello, I've inherited a large (31-bit) application with little documentation and lots and lots of BASRs to subprograms. I can't tell how deep the calls can go, but I've seen over 20 levels deep. I'm looking for a way to keep track of the stack level of a routine that doesn't add much code. There are standard $SAVE and $RETN macros I think I can use to keep track of the stack level.
There are also a large number of $TRACE calls where I've added an IIHF statement in the macro to load a global counter (for the number of trace statements in that assembly--there are over 4000 of those in some cases). For example, IIHF R2,&ZTSEQ, where &ZTSEQ is a GLBLA incremented once each time the $TRACE macro is encountered. Sorry for all the background. What I'm looking for are "high-half" versions of LA and BCTR commands, so that the incrementing and decrementing could be done with 2 statements per CSECT--without affecting the low halves of the register. For example in 31-bit land if R2 was always available, I could say "LA R2,1(R2)" at the start of the modules, and "BCTR R2,0" at the end. In this case reg 2 would always be the stack level. I'd also need to keep the application compatible with z9 (OPCODE(ZS3)) or later machines. Can anyone tell me if such statements exist in OPCODE(ZS3)? I can't find them if they are there. TIA, Wendell Lovewell