If you are passing control between programs executing in different addressing modes, you must change the AMODE indicator in the PSW. The BASSM and BSM instructions perform this function for you. You can transfer to a program in another AMODE using a BASSM instruction and then return by means of a BSM instruction. This sequence of instructions ensures that both programs execute in the correct AMODE.
TEST CSECT
TEST AMODE 24
TEST RMODE 24
.
.
L 15,EPA OBTAIN TRANSFER ADDRESS
BASSM 14,15 SWITCH AMODE AND TRANSFER
.
.
EXTRN EP1
EPA DC A(X'80000000'+EP1) POINTER DEFINED ENTRY POINT ADDRESS
.
.
END
____________________________________________________________
EP1 CSECT
EP1 AMODE 31
EP1 RMODE ANY
.
.
SLR 15,15 SET RETURN CODE 0
BSM 0,14 RETURN TO CALLER'S AMODE AND TRANSFER
END