Example 5 (Assembler)

The following is an example of an assembler program calling IDISNAP.
         TITLE 'HLASM EXAMPLE'
R0       EQU   0
R1       EQU   1
R3       EQU   3
R13      EQU   13
R14      EQU   14
R15      EQU   15
ASMSNAP  CSECT
ASMSNAP  AMODE 31
ASMSNAP  RMODE ANY
         PRINT   GEN
         STM   14,12,12(R13)
         LR    R3,R15
         USING ASMSNAP,R3
         LA    R1,REGSAVE
         ST    R13,4(,R1)
         LR    R13,R1
         WTO   'START OF ASMSNAP'
         LOAD  EP=IDISNAP
         LTR   R15,R15
         BNZ   ERROR
         LR    R15,R0
         LA    R1,0
         CALL  (15)                CALL IDISNAP
         WTO   'END OF ASMSNAP'
         SR    R15,R15             RC=0
         B     RETURN
ERROR    WTO   'ERROR LOADING IDISNAP'
RETURN   L     R13,4(,R13)
         L     14,12(,R13)
         LM    R0,12,20(R13)
         BR    R14                 RETURN TO CALLER
         DROP  ,
REGSAVE  DS    18F
         LTORG
         END   ASMSNAP