               JOB  RIPPLE READ                                            1040A
               ctl  6611
     *
     * 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
  368          dcw  #1
     *
     cont      equ  421  No code here -- detail routine only chains
     *
     tapes3    equ  1262           1 IF TESTS ARE NOT READ FROM TAPE
     tapes4    equ  1263           1 IF TESTS ARE NOT 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  switch,tapes4,1 USE WHEN TESTS ARE RUN FROM TAPE
  385          b    taperd           ,,
  389switch    nop  0                ,,
  393          mcw  bcont&3,switch&3 ,,
  400begin     cs   332            START TEST
  404          cs
  405          bce  titlpr,titlsw,1  BR TO TITLE PRINT ROUTINE IF 1 IN S52
  413          cw   d1&1,d2&1      EXPAND TABLE FROM 701-760 TO 701-880
  420          lca  d3,d4            ,,
  427          lca  d3,d5            ,,
  434          cw   d3&1,d4&1        ,,
  441outer     lca  k01,ccount     SET CARD COUNTER TO ONE
  448          cs   80             CLEAR READ AREA
  452          sw   1              SET WM IN 001
  456again     r                   READ
  457          lca  80,280         LOAD CARD INTO PRINT AREA
  464          lca  ccount,299     LOAD CARD NUMBER INTO PRINT AREA
  471          lca  rstart,rcount  START RIPPLING COUNTER AT 779
  478          a    ccount,rcount  ADD CARD COUNTER TO RIPPLING COUNTER
  485          mcw  rcount,*&4     MOVE RIPPLING COUNTER INTO NEXT INSTRUCT
  492          c    5777&X1,80     COMPARE TABLE WITH CARD
  499          bu   errprt         BRANCH TO ERROR PRINT ROUTINE IF UNEQ
  504          bss  corr,c         C ON TO CORRECT PRINT
  509test      c    ccount,k60     COMPARE CARD COUNTER WITH 60
  516          bu   more           BR TO ADD 1 TO CARD COUNTER IF NOT 60
  521          b    done           BRANCH TO SENSE D IF 60
  525more      a    k01,ccount     ADD 1 TO CARD COUNTER
  532          b    again          BRANCH TO READ NEXT DETAIL CARD
  536done      bss  outer,D        D ON TO REPEAT TEST
  541          bin  detail,        BRANCH TO READ NEXT RECORD
               org  689
  690k01       dcw  01             CONSTANT TO INCREMENT CARD COUNTER
  692ccount    dcw  @xx@           CARD COUNTER
  694k60       dcw  60             CONSTANT TO STOP CARD COUNTER
  697rstart    dsa  d3&19          CONSTANT TO START RIPPLING COUNTER
  700rcount    dsa  5777&X1        RIPPLING COUNTER
  720d1        dcw  @AKT4 BLU5"CMV6 DNW7_@   TABLE
  740d2        dcw  @EOX8 FPY9+GQZ0 HR'#(@     ,,
  760d3        dcw  @I-,@ &$%1?.*/2 )JS3!@     ,,
  820d4        ds   60
  880d5        ds   60
               org  900
  900errprt    lca  error,285      BEGIN ERROR PRINT ROUTINE
  907          bss  errhlt,e       E ON TO ERROR STOP
  912corr      w    loop           PRINT CARD
  916errhlt    h    test           ERROR STOP
  920loop      cs   299            CLEAR PRINT AREA
  924          sw   201            SET WM IN PRINT AREA
  928          mcw  rcount,*&4     MOVE RIPPLING COUNTER INTO NEXT INSTRUCT
  935          mcw  5777&X1,280    MOVE TABLE INTO PRINT AREA
  942          w                   PRINT TABLE
  943          cs   299            CLEAR PRINT AREA
  947          w    test           SPACE
  970          dcw  #1             WORD MARK
               org  1110
 1114error     dcw  @ERROR@        CONSTANTS
 1119          dc   #5
 1139          dcw  @FIRST LINE CARD     @     ,,
 1159          dcw  @                    @     ,,
 1179          dcw  @SECOND LINE TABLE   @     ,,
 1199          dcw  @                    @     ,,
     *
     * 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
     hdrs      equ  1120   All programs put headers in 1120-1199
     titlex    equ  413    All routines must return here after title
     *
               org  1200
 1200titlpr    w                 Print (space).
 1201          sw   49           Set WM for Title and Block No.
 1205          lca  77,277       Load Title and Block No. in Print Area.
 1212          w                 Print Title and Block No.
 1213          cs   277          Clear Print Area
 1217          w                 Print (space).
 1218nohead    cw   hdrs&20,hdrs&40  Clear Word Marks in second
 1225          cw   hdrs&60      line stored information.
 1229          lca  hdrs&69,270  Load second line.
 1236          w                 Print second line.
 1237          cs   270          Clear Print Area.
 1241          w    titlex       Print (space) and branch to main program.
 1245          dcw  #1
               end  start
