               JOB  RESET ADD & SUB                                        0330B
               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
     *
     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          b    switch         USE WHEN TESTS ARE RUN FROM TAPE
  381          org  385              ,,
  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          cs   80             CLEAR READ AREA
  417next      b    detail         BRANCH TO PROGRAM CHAINING ROUTINE
  421cont      sw   1,78           LOAD PRINT AREA
  428          lca  80,299           ,,
  435          lca  72,272           ,,
  442          BIN  516,
               ORG  449
  449cont3     SW   261              ,,
  453          BCE  scope2,10,     BR TO RESET ADD 1 POS FLD IF BL IN 010
  461scope1    ZA   210,270        RESET ADD 10 POSITION FIELD
  468          BSS  scope,B        B ON TO SCOPE
  473          C    270,250        TEST FOR ERROR
  480          B    test             ,,
  484scope2    LCA  201,261        LOAD A FIELD
  491za2       ZA   261            RESET ADD 1 POSITION FIELD
  495          BSS  scope,B        B ON TO SCOPE
  500          C    261,241        TEST FOR ERROR
  507test      BU   errprt         BRANCH TO ERROR PRINT ROUTINE IF UNEQ
  512          B    bump           Go bump counter
  516cont2     SW   206,241
  523          BCE  doza,72,A      Do ZA?
  531          BCE  dozs,72,S      Do ZS?
  539badinp    H    badinp         Neither -- erroneous input
  543doza      LCA  za,scope1
  550          LCA  za,za2
  557          B    cont3
  561dozs      MCW  zs,scope1
  568          MCW  zs,za2
  575          B    cont3
  579          DCW  #1
               ORG  900
  900errprt    lca  error,285      BEGIN ERROR PRINT ROUTINE
  907          bss  errhlt,E       E ON TO ERROR STOP
  912          w    bump           ERROR PRINT
  916errhlt    h    bump           ERROR STOP
  920bump      a    *-6,count      Bump count
  927          bce  clear,count-1,9  Ninety times?
  935scope     cs   332
  939          cs
  940          b    cont
  944clear     s    count
  948          bss  corr,C
  953          b    loop
  957corr      w
  958loop      bss  cont,D
  963          b    detail
  970count     dcw  @000?@
  971za        ZA
  972zs        ZS
               org  1110
 1114error     dcw  @ERROR@
 1119          dcw  @     @
 1139          dcw  @A FIELD             @
 1159          dcw  @B FIELD             @
 1179          dcw  @RESULT SHOULD BE    @
 1199          dcw  @RESULT IS           @
     *
     * 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).
 1218          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
