               JOB  RIPPLE PUNCH                                           1030B
               ctl  6611
     *
     * Sense switches:
     * B on to repeat inner test -- for scoping
     * D on to repeat test without reading new detail
     *
     * Halts:
     * 499 (500 in I-STAR) if punch-and-branch fails to branch
     *
     * Stuff in the preamble
     *
               org  333
     *
     * Set up for one-field-per-card format and begin loading
     *
  333start     sw   8,12           PROGRAM CHAINING ROUTINE
  340reload    sw   1                ,,
  344          r    1                ,,
     *
     * Look for next program -- A in column 80
     *
  348detail    r                   READ DETAIL OR PROGRAM HEADER
  349tptest    bce  *&5,80,a       BRANCH IF HEADER
  357bcont     b    cont           CONTINUE PROGRAM
  361          cs   reload,80      BRANCH TO CHAINING ROUTINE
     *
     tapes3    equ  1262           1 IF TESTS ARE READ FROM TAPE
     tapes1    equ  1268   blank indicates the tape loader
     taperd    equ  1288   tape read routine?
     tapes2    equ  1398   GM indicates the tape loader
     *
               org  377
  377          bce  begin,tapes3,1
  385          bin  taperd,
               org  400
  400begin     cs   332            START TEST
  404          cs
  405          bce  titlpr,titlsw,1  BR TO TITLE PRINT ROUTINE IF 1 IN S52
  413          bin  ret,
               org  420
     cont      equ  ret  Detail usually continues at 421
  420ret       cw   d1&1,d2&1      EXPAND TABLE FROM 701-760 TO 701-880
  427          lca  d3,d4            ,,
  434          lca  d3,d5            ,,
  441          cw   d3&1,d4&1        ,,
  448          cs   180            CLEAR PUNCH AREA
  452          sw   101            SET WM IN PUNCH AREA
  456inner     lca  kstart,count   LOAD CARD COUNTER
  463next      mcw  count,*&4      MOVE CARD COUNTER INTO NEXT INSTRUCTION
  470          mcw  d3&20,180      MOVE TABLE INTO PUNCH AREA
  477          bwz  scope2,101,2   BR TO PUNCH AND BRANCH IF NO ZONE IN 101
  485scope1    p                   PUNCH
  486          bss  scope1,B       B ON TO SCOPE
  491          b    test           BRANCH TO TEST FOR LAST CARD
  495scope2    p    branch         PUNCH & BRANCH
  499          h                   ERROR STOP IF NO BRANCH
  500branch    bss  scope2,B       B ON TO SCOPE
  505test      c    done,count     COMPARE CARD COUNTER WITH 839
  512          bu   more           BRANCH TO ADD 1 IF NOT 839
  517          bss  inner,d        D ON TO REPEAT TEST
  522          b    loop
  526more      a    k1,count       ADD 1 TO CARD COUNTER
  533          b    next           BRANCH TO PUNCH NEXT CARD
  537loop      cs   180            CLEAR PUNCH AREA
  541          bin  detail,        BRANCH TO READ NEXT RECORD
               org  600
  604          dcw  @     @
  607kstart    dsa  d3&20          CONSTANT TO START CARD COUNTER
  608k1        dcw  1              CONSTANT TO INCREMENT CARD COUNTER
  611done      dsa  d3&79          CONSTANT TO STOP CARD COUNTER
  614count     dcw  @XXX@          CARD COUNTER
               org  701
  720d1        dcw  @AKT4 BLU5"CMV6 DNW7_@   TABLE TO BE RIPPLE PUNCHED
  740d2        dcw  @EOX8 FPY9+GQZ0 HR'#(@     ,,
  760d3        dcw  @I-,@ &$%1?.*/2 )JS3!@     ,,
  820d4        ds   60
  880d5        ds   60
     *
     * Title print routine.  Notice that in the original format,
     * the title and ID are in CC 49-77 of the last card -- the one
     * that transfers control to the program.
     *
     titlsw    equ  1252   1 to use title print routine
     *
               org  1200
 1200titlpr    W                  Print (space).
 1201          SW   49            Set WM for Title and Block No.
 1205          LCA  76,276        Load Title and Block No. in Print Area.
 1212          W                  Print Title and Block No.
 1213          CS   277           Clear Print Area
 1217          W    cont          Print (space).
 1221          dcw  #1
               END  333
