Given those requirements, the only thing your subroutine needs to do is return with BSM 0,R14. It will do the right thing in every case you mentioned.
As you didn't originally specify much of this, we had to qualify answers with various unlikely scenarios. Fact is, BSM 0,R14 works correctly for any call by BASSM, BSM, BASR, BAS, JAS (BRAS), JASL (BRASL), BALR, and BAL (BAL only in 31-bit mode). The "special" cases, especially when R14 is loaded up separately, are unpredictable. Fortunately, those are rare, and slightly rarer coded incompetently, such that R14 has the wrong AMODE indicator. Your list of requirements do not say you need to support any of those. Furthermore, your program can switch AMODE all it likes. The BSM 0,R14 will restore the correct AMODE on return to the caller. And I don't see that LE is relevant. Seems like a case of over-thinking and under-learning. sas On Fri, Aug 14, 2020 at 6:23 PM Tony Thigpen <[email protected]> wrote: > I have been reading all the "that is not a good way to do it" posts, so > here it the challenge to all those nay-sayers. > > It's time to 'put-up' or 'shut-up'. > >
