There was a TriModal handout from Share that showed how to call and switch
address modes, it was excellent . It was by IBMer John Ehrman ....that says
it all to me.


Scott

On Saturday, August 22, 2015, [email protected] <[email protected]> wrote:

> Im posting he results of my sampe program for loading a 64BIT Amode
> program and invoking it via BSSM.
> .
> The Driving program is AMODE31 RMODE ANY
> The program that is loaded was Linked Edit as AMODE 64 and RMODE ANY.
> .
> I wanted to accomplish two methods of invoking the same 64BIT AMODE
> program. The function of 64BIT AMODE Program (PROG64) is simplistic;(1)
> established the save areas, (2) acquire a Memory Segment, (3) DETACHE the
> memory Segment, and (4)restores the callers environment and return.
> .
> .
> The Driver Routine issues a LINK to PROG64
> And Upond Return LOADs PROG64 and then BASSM to it.
> .
> .
> I had to use a LINKX macro as LINK incurred an ABEND of 0C6.
> Then the BASSM failed because PROG64 returned witha BR14.
> I then modified the PROG64 program to issue a BSM 0,14 as the return
> instruction.
> This succeded for both LINKX and LOAD/BASSM, I am still fine tuning this
> logic.
> .
> .
> The Driveing routine is posted below:
>
> GOCHECK  CNOP  2,4            ALIGNMENT
> BAKR  R14,0          SAVE CALLERS ENVIRONMENT
>          LARL  R12,DRIV64A    ESTABLISH BASE REGISTER
>          LARL  R13,SAVE64     REGISTER SAVE Area
> *                                                                *
>          WTO   '&CSECT - LINK Routine'
>          SYSSTATE ASCENV=P,AMODE64=YES,ARCHLVL=2
>          LARL  R2,PROG64$
>          LINKX EPLOC=(R2),AMODE64OK=YES    ISSUE LINKX
>          SYSSTATE AMODE64=NO
> *
>          WTO   '&CSECT - LOAD Routine'
>          LARL  R2,PROG64$
>          LOAD  EPLOC=(R2)          ISSUE LOAD
>          STM   R15,R1,LOADREGS     REGS AFTER LOAD
>          STG   R0,MOD@             64Bit Module
>          LGR   R15,R0              64Bit Address
>          BASSM R14,R15             Invoke 64Bit Module
> *
>          WTO   '&CSECT - Return'
> *
>           DS    0D
>          DC    CL8'SAVEAREA'
> SAVE64   DS   34A
>          DS    0D
>          DC    CL8'LOADREGS'
> LOADREGS DC    4A(0)               REGISTERS AFTER LOAD
>          DS   0AD
> MOD@     DC    AD(0)
> SAVEG15  DC    AD(0)
>          DC    AD(0)
>          DC    AD(0)
>          DC    AD(0)
> *
> *****************************************************************
>
> Paul D'Angelo
> *************
>

Reply via email to