Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example of a base routine and a subroutine

&pagelevel(4)&pagelevel

The choice of Columbus-Assembler for the example is deliberate, as it means that explicit saving of the register contents and reloading can be dispensed with. Users need only make use of the framework presented below and can write the rest of the routines in Assembler or Columbus-Assembler as desired.

The names of the base routine and the subroutine must be unique within the system and must not clash with names in system modules.

Base routine

         START
EXITCOD  AMODE  ANY
EXITCOD  RMODE  ANY
EXPARLI  EX090                            DSECT for exit 090
EXITCOD  CSECT
****************************************************************************
*        MAINROUTINE                                                       *
*        R1 = EXPARLI A(PARAMETER LIST OF EXIT#90                          *
****************************************************************************
EXIT090  @ENTR  TYP=E,ENV=SPLSPEC,RETURNS=NO
         ENTRY  EXIT090
         USING  EXPARLI,R1                Use layout of paralist of exit 090
****************************************************************************
*        CALL FIRST SUBROUTINE                                             *
****************************************************************************
         @PASS  EXTNAME=SUBROUT1            Call Subrout1
         @IF    NZ                           If return code not ok 
         LTR    R15,R15
         @THEN
         ST     R15,IEXRC                 set return code in exit paralist
         @EXIT                            then return to system
         @BEND
****************************************************************************
*        CALL SECOND SUBROUTINE                                            *
****************************************************************************
         @PASS  EXTNAME=SUBROUT2            Call Subrout2
         @IF    NZ                            If return code not ok
         LTR    R15,R15
         @THEN
         ST     R15,IEXRC                 set returncode in exit paralist
         @EXIT                            then return to system
         @BEND
****************************************************************************
*        CALL FURTHER ROUTINES                                             *
****************************************************************************
         :
         :
         @PASS  EXTNAME=SUBROUTN          Call Subrout2
         @IF    NZ                        If return code not ok 
         LTR    R15,R15
         @THEN
         ST     R15,IEXRC                 set returncode in exit paralist
         @EXIT                            then return to system
         @BEND
****************************************************************************
*        END OF MAIN ROUTINE                                               *
****************************************************************************
         @EXIT
         @END
         END

Subroutine

SUBEX001 CSECT 
         PRINT  GEN
SUBEX001 AMODE  ANY
SUBEX001 RMODE  ANY
EXITPL   EX090
SUBROUTN @ENTR  TYP=I,ENV=SPLSPEC,RETURNS=NO
         ENTRY  SUBROUTN
****************************************************************************
*        Application-specific instructions                                 *
****************************************************************************
         L      R15,IADD                     RETURNCODE WEITERREICHEN
         @EXIT   ,                           RETURN TO BASISROUTINE
         @END    ,
         END