Subroutine Coding Examples

Figure 183. Examples of Coding Subroutines
*...1....+....2....+....3....+....4....+....5....+....6....+....7...+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
 *
 * For a subroutine, positions 7 and 8 can be blank or contain SR.
 *
C                         :
C                         :
C                   EXSR      SUBRTB
C                         :
C                         :
C                         :
CL2                 EXSR      SUBRTA
C                         :
C                         :
C                         :
C     SUBRTA        BEGSR
C                         :
C                         :
C                         :
 *
 *  One subroutine can call another subroutine.
 *
C                   EXSR      SUBRTC
C                         :
C                         :
C                         :
C                   ENDSR
C     SUBRTB        BEGSR
C                         :
C                         :
C                         :
 *
*...1....+....2....+....3....+....4....+....5....+....6....+....7...+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
 *
 *  GOTO and TAG operations can be used within a subroutine.
 *
C     START         TAG
C                         :
C                         :
C                         :
C   23              GOTO      END
C                         :
C                         :
C                         :
C   24              GOTO      START
C     END           ENDSR
C     SUBRTC        BEGSR
C                         :
C                         :
C                         :
C                   ENDSR
 *


[ Top of Page | Previous Page | Next Page | Contents | Index ]