On Tue, 21 Oct 2014 13:31:44 +0000, Chase, John wrote:

>> From: IBM Mainframe Discussion List On Behalf Of Tom Marchant 
>>   
>> If you have an assembler called program, you don't need to issue SAM31 
>> before returning as long as you 
>> were called with one of BASSM, BASR or BALR. In all of these cases the 
>> return register (R14) contains 
>> sufficient information so that BSM will return correctly. 
>
>But see APAR PI17184 for an instance when BSM did not return correctly.

That's why I hedged my post the way I did. It is not at all clear to me that 
LE always used BASSM, BALR or BASR to call. The APAR information is confusing, 
at least to me.

<quote>
Normally this is not an issue with GOBACK, since BALR is used to return 
to the caller. However, when LE stack frame exit is introduced to the 
stack chain, the CEEHSFXA routine will get control and BSM is used to 
return to the caller instead.
</quote>

I've never seen a case where "BALR is used to return to the caller."
I think I may have seen where BSM is used by the caller to pass control to the 
called program. In particular, where there is an interface routine ("glue 
code") 
between the calling application and the called program.

So, yes, if your program changes the AMODE after receiving control, you should 
change it back to what it was. And not just blindly set it to AMODE 31.

-- 
Tom Marchant

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to