Summary:

If you want to return in the AMODE of the caller:
-- If you can be entered by BASSM, you must not BSM 14,0.
-- If you cannot be entered by BASSM but could be entered by something 
other than a BASR-like instruction
(including BALR in AMODE 24, LA/B and others), and don't want to run in 
caller's AMODE and do a BR to return, you need to BSM
-- If you know that you are entered by a BASR-like instruction there is no 
need to BSM 14,0.

<snip>
    LA    14,0(,14)  Fix-up address (in case 24 bit)
    BSM   14,0       Now BSM 0,14 will restore the current amode
</snip>
There is no reason to do that "LA" unless saving the result within an 
actual PSW.
It is perfectly fine to have garbage in the high byte when you issue BSM 
0,14.
In all cases that matter BSM will set the AMODE 24/31 bit and the AMODE 63 
bit properly

I added "that matter" because of the entertaining case of someone setting 
reg 14 to an odd address and then branching to your routine.
If not in AMODE 64, the BSM 14,0 will leave bit 63 unchanged. And the 
resulting BSM 0,14 will branch in AMODE 64 to the one-less even address 
(plus 2G if reg 14 did not have that bit on but the branch was in AMODE 
31). 

Peter Relson
z/OS Core Technology Design

Reply via email to