               JOB  backspace skip
               ctl  6611
     *
     * Stuff in the preamble -- not in one-field-per-card format
     *
               org  333
     *
     * Set up for one-field-per-card format and start loading
     *
               sw   8,12
     reload    sw   1
               r    1
     *
     * Look for next program -- A in column 80
     *
     nxprog    r
     tptest    bce  *&5,80,a
               b    421    What's going to be at 421?
               cs   reload,80
               dcw  #1
     *
     * 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
     titlpr    w                 Print (space).
               sw   49           Set WM for Title and Block No.
               lca  77,277       Load Title and Block No. in Print Area.
               w                 Print Title and Block No.
               cs   277          Clear Print Area
               w                 Print (space).
               cw   hdrs&20,hdrs&40  Clear Word Marks in second
               cw   hdrs&60      line stored information.
               lca  hdrs&79,280  Load second line.
               w                 Print second line.
               cs   280          Clear Print Area.
               w    titlex       Print (space) and branch to main program.
               dcw  #1
     *
     tapes1    equ  1268   blank indicates the tape loader
     taperd    equ  1288   tape read routine?
     tapes2    equ  1398   GM indicates the tape loader
     *
     * Stuff that is in one-field-per-card format
     *
               ORG  377
               BCE  taperd,tapes1,  USE WHEN TESTS ARE RUN FROM TAPE
               BIN  start,           ,,
               ORG  400
     start     CS   332            START TEST
               CS
     bop       BCE  titlpr,titlsw,1  BR TO TITLE PRINT ROUTINE IF 1 IN S52
               org  titlex
               MCW  k0001,passno   SET PASS COUNTER TO ONE
     rwd       RWD  4              REWIND
     loop      LCA  nop,sw1        LOAD -N- IN LOCATION sw1
     nop       NOP                 NOP
               CS   299            CLEAR PRINT AREA
               MCW  passno,203     MOVE PASS NO. IN PRINT AREA
               MCW  write,211      MOVE WORD -WRITE- IN PRINT AREA
               LCA  rec1,226       LOAD RECORD 1 & GM IN PRINT AREA
               LCA  rec2,260       LOAD RECORD 2 & GM IN PRINT AREA
               SW   226,260        SET WM IN GM LOCATIONS
               WTW  4,216          WRITE RECORD 1
               BER  552            BRANCH IF TAPE WRITE ERROR
     eftst1    BEF  rwd            BRANCH IF END OF REEL
               MCW  k0001-1,rwc    SET RE-WRITE COUNTER TO ZERO
     wrec2     WTW  4,250          WRITE RECORD 2
               BSS  eftst2,B       B ON TO SCOPE
               BCE  ertest,rwc-1,1  BRANCH IF 10 IN RE-WRITE COUNTER
               A    rec1-10,rwc    ADD 1 TO RE-WRITE COUNTER
     eftst2    BEF  rwd            BRANCH IF END OF REEL
               BSP  4              BACKSPACE
               SKP  4              SKIP
               BIN  wrec2,         BRANCH TO REWRITE RECORD 2
               ORG  552
               LCA  bop,sw1        LOAD -B- IN LOC. sw1 TO BRANCH ON ERROR
               MCW  tape,232       MOVE TAPE WRITE ERROR TO PRINT
               BIN  eftst1,        BRANCH TO TEST FOR END OF REEL
               ORG  575
     ertest    BER  set1           BRANCH IF TAPE WRITE ERROR
     eftst3    BEF  rwd            BRANCH IF END OF REEL
     sw1       NOP  erprnt         NOP IF NO ERRORS - BRANCH IF ANY ERRORS
               DC   @ @         
               BSS  erwrit,C       C ON TO CORRECT PRINT
               BIN  rdtest,        BRANCH TO BEGIN READ PORTION OF TEST
               ORG  607
     set1      LCA  bop,sw1        LOAD -B- IN LOC. sw1 TO BRANCH ON ERROR
               MCW  tape,266       MOVE TAPE WRITE ERROR TO PRINT
               BIN  eftst3,        BRANCH TO TEST FOR END OF REEL
               ORG  630
     erprnt    MCW  error,285      MOVE WORD ERROR TO PRINT AREA
               BSS  erhalt,E       E ON TO ERROR STOP
     erwrit    W    rdtest         PRINT
     erhalt    H                   ERROR STOP
               BIN  rdtest,        BRANCH TO BEGIN READ PORTION OF TEST
               ORG  694
     rdtest    LCA  nop,sw2        LOAD -N- IN LOCATION sw2
               CS   299            CLEAR PRINT AREA
               MCW  passno,203     MOVE PASS NO. IN PRINT AREA
               MCW  read,210       MOVE WORD -READ- IN PRINT AREA
               LCA  gmwm,226       LOAD GM-WM FOR RECORD 1
               LCA  gmwm,260       LOAD GM-WM FOR RECORD 2
               BSP  4              BACKSPACE
               BSP  4              BACKSPACE
               RTW  4,216          READ RECORD 1 FROM TAPE
               BSS  read2,B        B ON TO SCOPE
               BER  set2           BRANCH IF TAPE READ ERROR
     testeq    C    225,1029       COMPARE TAPE REC 1 WITH REC IN STORAGE
               BU   noteq1         BRANCH IF ERROR
     read2     RTW  4,250          READ RECORD 2 FROM TAPE
               BSS  rdtest,B       B ON TO SCOPE
               BER  rderr          BRANCH IF TAPE READ ERROR
     test2     C    259,1049       COMPARE TAPE REC 2 WITH REC IN STORAGE
               BU   noteq2         BRANCH IF ERROR
     sw2       NOP  errtn2         NOP IF NO ERRORS - BRANCH IF ANY ERRORS
               DC   @ @         
               BSS  erprt2,C       C ON TO CORRECT PRINT
     testd     BSS  rdtest,D       D ON TO REPEAT READ PORTION OF PROGRAM
               BCE  done,passno-1,1  BRANCH IF 10 IN PASS COUNTER
               A    rec1-10,passno  ADD 1 TO PASS COUNTER
               BIN  loop,          BRANCH TO REPEAT PROG. IF NOT 10TH PASS
               ORG  850
     done      BSS  loop,G         G ON TO REPEAT TEST
               RWD  4              REWIND
               CS   nxprog,299     CLEAR GM-WM & BRANCH TO LOAD NEXT PROG.
     set2      LCA  bop,sw2        LOAD -B- IN LOC. sw2 TO BRANCH ON ERROR
               MCW  tape,232       MOVE TAPE READ ERROR COMMENT TO PRINT
               BIN  testeq,        BRANCH TO TEST FOR COMPARE ERROR
               ORG  887
     noteq1    LCA  bop,sw2        LOAD -B- IN LOC. sw2 TO BRANCH ON ERROR
               MCW  compar,244     MOVE COMPARE ERROR COMMENT TO PRINT
               BIN  read2,         BRANCH TO READ RECORD 2
               ORG  907
     rderr     LCA  bop,sw2        LOAD -B- IN LOC sw2 TO BRANCH ON ERROR
               MCW  tape,266       MOVE TAPE READ ERROR COMMMENT TO PRINT
               BIN  test2,         BRANCH TO TEST FOR COMPARE ERROR
               ORG  927
     noteq2    LCA  bop,sw2        LOAD -B- IN LOC sw2 TO BRANCH ON ERROR
               MCW  compar,278     MOVE COMPARE ERROR COMMENT TO PRINT
               BIN  sw2,           BRANCH TO NOP OR BRANCH
               ORG  950
     errtn2    MCW  error,285      MOVE WORD ERROR TO PRINT AREA
               BSS  erhlt2,B       E ON TO ERROR STOP
     erprt2    W                   PRINT
               WM   testd          PRINT WORD MARKS
     erhlt2    H                   ERROR STOP
               BIN  testd,         BRANCH TO SENSE D
               ORG  1020
     rec1      DCW  @1111111111"@   RECORD ONE    GM IN '30
     k0001     DCW  @0001     @    CONSTANT TO INCREMENT PASS & RE-WR. CTRS
     rec2      DCW  @RWRWRWRWRW" @   RECORD TWO    GM IN '50
     passno    dcw  @XX@           COUNTER FOR COUNTING NO. OF PASSES
     rwc       DCW  @XXX@          COUNTER FOR COUNTING NO. OF RE-WRITES
               dc   @   @
     write     dcw  @WRITE@        CONSTANTS FOR PRINTOUTS
     read      DCW  @READ@           ,,
     tape      DCW  @TAPE@           ,,
     compar    dcw  @compare@        ,,
     error     DCW  @ERROR               @     ,,
               ORG  hdrs
               DCW  @PASS  OPER.    RECOR@   CONSTANTS FOR HEADINGS
               DCW  @D ONE    TYPE OF ERR@     ,,
               DCW  @ORS      RECORD TWO @     ,,
               DCW  @   TYPE OF ERRORS   @     ,,
               ORG  1250
     gmwm      DCW  @"@              ,,
     *
     * Stuff at the end.  Not in one-field-per-card format
     * Looks like it's for automatically figuring out whether the
     * program is loaded from tape.
     *
               org  19
     begin     bce  ontape,tapes2,"  GM at tapes2?
               b    start
     ontape    lca  btape&4,tptest&3
               b    1604             What's going to be at 1604?
     btape     b    taperd
               END  begin
