
*                     * 
**  EXECUTE MUNLOCK  ** 
*                     * 
* 
*  UNLOCK THE SPECIFIED BLOCKS BY REMOVING THEM FROM THE  LOCKED
*  BLOCKS TABLE, SHORTENING OR ELIMINATING THE ENTRIES AS 
*  NECESSARY. 
* 
MLK20 EQU * 
      JSB LBSRH     SEARCH LOCKED BLOCKS TABLE
      JMP MLK21     SAME STARTING BLOCK 
      JMP MLK24     BETWEEN TWO BLOCKS
      NOP 
      JSB CPB       CHECK PRECEEDING BLOCK
      JMP MLK99     ENTRIES MERGED
      JMP LD22C,I   NO WORK DONE
MLK21 EQU * 
      INB           IS THIS 
      LDA CTMP0       ENTRY 
      CMA,CLE           COMPLETELY
      ADA B,I             ENCLOSED? 
      SEZ,RSS 
      JMP MLK22     YES 
      INA           NO, SAVE
      STA B,I         NEW LENGTH
      ADB CM1       SAVE NEW
      LDA CTMP2       STARTING
      STA B,I           ADDRESS 
      JMP MLK99 
MLK22 EQU * 
      ADB CM1       ELIMINATE LOCKED
      JSB ELBEN       BLOCK ENTRY 
* 
*  CHECK SUCCEEDING ENTRIES 
* 
MLK23 EQU * 
      LDA B,I       ANY MORE
      SZA,RSS         ENTRIES?
      JMP MLK99     NO
      LDA CTMP2     YES,
      CMA,CLE,INA     OVERLAP 
      ADA B,I         NEXT
      SEZ                 ENTRY?
      JMP MLK99     NO
      INB           YES,
      ADA B,I         COMPLETELY
      SZA,RSS           ENCLOSE IT? 
      JMP MLK22     YES 
      SEZ,RSS       MAYBE 
      JMP MLK22     YES 
      STA B,I       NO, SAVE LENGTH 
      ADB CM1       SAVE NEW
      LDA CTMP2       STARTING
      STA B,I           BLOCK 
      SKP 
* 
*     WRITE TABLE BACK TO DISC
* 
MLK99 EQU * 
      LDA CM256     WRITE LOCKED
      LDB C.3 
      JSB DAIRC,I     BLOCKS TABLE
      LDB MTRLC 
      JSB DISCL,I       TO DISC 
      JMP LD22C,I 
* 
MLK24 EQU * 
      JSB CPB       CHECK PRECEEDING BLOCK
      JMP MLK23     GO CHECK
      JMP MLK23       SUCCEEDING ENTRIES
      SKP 
*                              *
**  SEARCH FOR LARGE INTEGER  **
*                              *
* 
*  SEARCH THE INPUT STRING FOR AN INTEGER LESS THAN 2**19. IF FOUND 
*  EXIT TO (P+2) WITH THE INTEGER IN INTMP[0:1] AND THE FOLLOWING 
*  CHARACTER IN (A).  OTHERWISE EXIT TO (P+1) 
* 
LGINT NOP 
      CCB           SET FLAG FOR
      STB CTMP5       INTEGER OCCURRENCE
      CLB           INITIALIZE
      STB INTMP       TWO DIGIT 
      STB INTMP+1       RESULT
LGIN1 EQU * 
      JSB GETCI,I   GET A CHARACTER 
      JMP LGIN2     CR
      JSB DIGCI,I   DIGIT?
      JMP LGIN2     NO
      STA CTMP5     YES, SAVE IT
      LDA INTMP+1   GET PREVIOUS
      LDB INTMP       RESULT
      ASL 2         MULTIPLY BY 4 
      CLE           ADD IN
      ADA INTMP+1     PREVIOUS RESULT,
      SEZ               PRODUCING A 
      INB                 MULTIPLICATION
      ADB INTMP             BY 5
      ASL 1         PRODUCE MULTIPLICATION BY 10
      CLE           ADD IN
      ADA CTMP5 
      SEZ             NEW DIGIT 
      INB 
      STB INTMP     SAVE NEW
      STA INTMP+1     NUMBER
      LDA INTMP     TOO 
      AND C.7 
      CPA INTMP       BIG?
      JMP LGIN1     NO
      JMP LGINT,I   YES 
LGIN2 EQU * 
      ISZ CTMP5     DID NUMBER OCCUR? 
      ISZ LGINT     YES 
      JMP LGINT,I   NO
      SKP 
*                               * 
**  TWO WORD INTEGER SUBTRACT  ** 
*                               * 
* 
*  SUBTRACT THE TWO WORD INTEGER IN [(B),(A)] FROM INTMP[0:1],
*  LEAVING THE RESULT IN [(B),(A)]. 
* 
TWSUB NOP 
      CMA,CLE,INA   NEGATE
      CMB,SEZ 
      INB             SUBTRAHEND
      CLE 
      ADA INTMP+1   ADD IN
      SEZ 
      INB             MINUEND 
      ADB INTMP 
      JMP TWSUB,I   EXIT
*                                   * 
**  COMPUTE DISC RELATIVE ADDRESS  ** 
*                                   * 
* 
*  ENTER WITH CTMP3 => THE FIRST WORD OF ONE SEGMENT OF THE DISC
*  EQT AND INTMP[0,1] = A DISC ADDRESS.  COMPUTE THE DISC RELATIVE
*  ADDRESS AND EXIT WITH IN IN [(B),(A)]. 
* 
CFTD  NOP 
      DLD CTMP3,I   GET FIRST SECTOR NUMBER 
      CLE,ERA       CONVERT 
      ERB             TO BLOCKS 
      SWP           SO SUBTRACT WILL WORK 
      JSB TWSUB     SUBTRACT IT 
      JMP CFTD,I
      SKP 
*                                *
**  SEARCH LOCKED BLOCKS TABLE  **
*                                *
* 
*  SEARCH THE LOCKED BLOCKS TABLE FOR THE FIRST ENTRY WHOSE ADDRESS 
*  IS >= CTMP1.  EXIT TO (P+1) IF IT IS EUAL OR (P+2) IF IT IS
*  GREATER, WITH (B) => THAT ENTRY.  IF NO ENTRY IS FOUND WHOSE 
*  ADDRESS IS GREATER AND THE TABLE IS NOT FULL, EXIT TO (P+3)
*  WITH (B) => THE END OF THE TABLE, OTHERWISE EXIT TO (P+4). 
* 
LBSRH NOP 
      LDB MTRLC     => FIRST ENTRY
LBSR1 EQU * 
      LDA B,I       GET ITEM
      SZA,RSS       FINISHED SEARCH?
      JMP LBSR2     YES, EXIT TO (P+3)
      CMA,CLE,INA   IS THIS 
      ADA CTMP1       ENTRY 
      SZA,RSS           EQUAL 
      JMP LBSRH,I   YES, EXIT TO (P+1)
      SEZ,RSS       NO, GREATER?
      JMP LBSR2+1   YES, EXIT TO (P+2)
      ADB C.2       NO, TABLE 
      CPB LBND        FULL? 
      RSS           YES, EXIT TO (P+4)
      JMP LBSR1     NO, LOOP
      ISZ LBSRH 
LBSR2 EQU * 
      ISZ LBSRH 
      ISZ LBSRH 
      JMP LBSRH,I 
*                                       * 
**  MAKE ROOM FOR LOCKED BLOCKS ENTRY  ** 
*                                       * 
* 
*  ENTER WITH (B) => THE PLACE IN THE LOCKED BLOCKS BUFFER WHERE
*  THE ENTRY IS TO BE INSERTED.  IF THE TABLE IS FULL, OUTPUT AN
*  ERROR MESSAGE, OTHERWISE MOVE THE TABLE TO MAKE ROOM FOR THE NEW 
*  ENTRY AND EXIT WITH (B) UNCHANGED. 
* 
MRLBE NOP 
      STB CTMP5     SAVE POINTER TO HOLE
      LDB LSTLB     IS THE
      LDA B,I         TABLE 
      SZA               FULL? 
      JMP MLK10     YES 
      STB CTMP3     NO, SAVE DESTINATION POINTER
      ADB CM2       SOURCE POINTER
MLK16 EQU * 
      LDA B,I       MOVE AN 
      STA CTMP3,I     ENTRY 
      CPB CTMP5     FINISHED MOVE?
      JMP MRLBE,I 
      ADB CM1       NO, UPDATE
      LDA CTMP3 
      ADA CM1         POINTERS
      STA CTMP3 
      JMP MLK16     LOOP
*                                  *
**  ELIMINATE LOCKED BLOCK ENTRY  **
*                                  *
* 
*  ENTER WITH (B) => THE ENTRY TO BE REMOVED.  MOVE THE TABLE UP
*  AND EXIT WITH (B) UNCHANGED. 
* 
ELBEN NOP 
      STB CTMP5     SAVE (B)
      STB CTMP3     SAVE DESTINATION POINTER
      ADB C.2       SOURCE POINTER
ELBE1 EQU * 
      CPB LBND      END OF TABLE? 
      JMP ELBE2-1   YES 
      LDA B,I       GET A WORD
      SZA,RSS       ZERO? 
      JMP ELBE2     YES, MOVE FINISHED
      STA CTMP3,I   NO, MOVE IT 
      ISZ CTMP3     BUMP
      INB             POINTERS
      JMP ELBE1 
      CLA           ZERO OUT
ELBE2 STA CTMP3,I     TWO WORDS 
      ISZ CTMP3         AFTER LAST
      STA CTMP3,I         ENTRY 
      LDB CTMP5     RESTORE (B) 
      JMP ELBEN,I 
*                            *
**  CHECK PRECEEDING BLOCK  **
*                            *
* 
*  ENTER WITH CTMP1 = STARTING ADDRESS, CTMP2 = ENDING ADDRESS + 1
*  OF NEW BLOCK AND (B) => PLACE TO INSERT BLOCK.  CHECK FOR THE NEW
*  BLOCK IN THE RANGE OF THE ENTRY PRECEEDING , AND IF SO 
*  COMBINE THE EXTRIES AND EXIT TO (P+1).  OTHERWISE EXIT TO (P+2). 
*  (B) REMAINS UNCHANGED. 
* 
CPB   NOP 
      CPB MTRLC     BEGINNING OF TABLE? 
      JMP CPB2      YES 
      ADB CM1       NO, NEW 
      LDA B,I 
      STA CTMP4 
      ADB CM1         BLOCK IN
      ADA B,I 
      CMA,CLE           RANGE OF
      ADA CTMP1 
      SEZ                 PRECEEDING ONE? 
      JMP CPB2-1    NO
      ISZ LUFLG     YES,
      RSS             UNLOCKING?
      JMP CPB3      YES 
      LDA B,I       NO, 
      CMA,INA         COMPUTE 
      ADA CTMP2         NEW 
      INB                 LENGTH
      STA CTMP4 
      CMA,CLE,INA 
      ADA B,I 
      SEZ 
      JMP *+3 
      LDA CTMP4 
      STA B,I               AND SAVE
      INB           RESTORE (B) 
      JMP CPB,I     EXIT TO (P+1) 
      ADB C.2       RESTORE (B) 
CPB2  EQU * 
      ISZ CPB       EXIT TO 
      JMP CPB,I       (P+2) 
CPB3  EQU * 
      INA,SZA,RSS   ADJACENT? 
      JMP CPB2-1    YES 
      LDA B,I       NO, COMPUTE 
      CMA,INA         NEW 
      ADA CTMP1         LENGTH
      INB                 AND 
      STA B,I               SAVE
      ADB CM1       IS THE
      LDA CTMP2       UNLOCKED
      CMA,CLE           PORTION 
      ADA B,I             IN THE MIDDLE 
      ADA CTMP4             OF THE PREVIOUS 
      SEZ,INA,RSS             BLOCK?
      JMP CPB1      NO
      STA CTMP4     YES, MAKE 
      ADB C.2       ROOM FOR
      JSB MRLBE         NEW ENTRY 
      LDA CTMP2     SAVE ADDRESS
      STA B,I         OF NEW ENTRY
      INB 
      LDA CTMP4     SAVE LENGTH 
      STA B,I         ALSO
      INB 
      JMP CPB,I 
CPB1  EQU * 
      ADB C.2 
      JMP CPB,I 
      HED CONSTANTS, TEMPORARIES, ETC 
CM512 DEC -512
CM256 DEC -256
CM32  DEC -32                                    [B]
CM10  DEC -10 
CM6   DEC -6
CM5   DEC -5
CM4   DEC -4
CM2   DEC -2
CM1   DEC -1
C.2   DEC 2 
C.3   DEC 3 
C.4   DEC 4 
C.7   DEC 7 
C.13  DEC 13
CB15  EQU C.13
C.15  DEC 15
C.17  DEC 17
C.20  DEC 20
C.22  DEC 22
CD25  DEC 25
C.26  DEC 26
CD37  DEC 37
CB54  OCT 54
CDASH OCT 55
* 
FM4   EQU CM4 
FM2   EQU CM2 
FM1   EQU CM1 
FD2   EQU C.2 
FD4   EQU C.4 
FD7   EQU C.7 
COUNT BSS 1 
CTMP0 BSS 1 
CTMP1 BSS 1 
CTMP2 BSS 1 
CTMP3 BSS 1 
CTMP4 BSS 1 
CTMP5 BSS 1 
FTMP0 EQU CTMP0 
FTMP1 EQU CTMP1 
FTMP2 EQU CTMP2 
FTMP3 EQU CTMP3 
INTMP BSS 2 
LUFLG BSS 1 
SBLCK BSS 2 
SLDAD BSS 2         STARTING DISC ADDR FOR EACH LIB ROUTINE 
SLDIR BSS 1         POINTER TO COM6 TABLE 
SYSLR BSS 1         LENGTH IN + #BLOCKS USED FOR LIB
SYSLF BSS 2         SYSTEM LIBRARY FLAGS         [B]
TPADR BSS 1 
* 
AASMA DEF AASM
ADVLA DEF ADVAL 
ASRDI DEF TTY35     SYSTEM CONSOLE DRIVER LINKAGE 
CDBA  DEF CDB       => CLAIM DISC BLOCKS ROUTINE
CHKSA DEF CHKSM 
CKFCB DEF CKFC                                   [B]
CMHND DEF MAXSC 
COFLF DEF COFLG     => CONFIGURATION OPTION FLAG
COM6I DEF COM6
DAIRC DEF DAIR
DIGCI DEF DIGCK 
DISCL DEF DISCZ 
DLBDA DEF SLDAD 
DSLCA DEF DSLLC 
EOFMA DEF EOFM
EOTMA DEF EOTM
FLRVA DEF FLRV      => MAG TAPE FILE RECOVERY 
GETCI DEF GETCR 
ILINC DEF ILIN
ILSLA DEF ILSL                                   [B]
ITSMA DEF SYSD
IVBNA DEF IVBN
JDCKF DEF JDECK 
JDSEI DEF JDSE
LABOA DEF LABOR 
LBND  DEF MTRLT+256 
LBTBI DEF MTRLT,I 
LBTFA DEF LBTF
LD22C DEF RLUM0                                  [B]
LIBRI DEF LIBRA 
LIBRJ DEF LIBRA,I 
LNKAD DEF LSLTB     LINKAGE TABLE ADDRESS 
LQAAA DEF LQAA
LSTLB DEF MTRLT+255 
MLTBC DEF MLTBL 
MLTBD DEF MLTBL+1 
MTAPA DEF MTD       MAG TAPE DRIVER LINKAGE 
MTFLA DEF MTFLG 
MTRLC DEF MTRLT 
READA DEF READ
RTADC DEF RTADT 
RTSWA DEF RTSWP 
SPFRB DEF SPFR
SPFUA DEF SPFU
SSEG1 DEF MLDLS     => SYSTEM SEG 1 
SSEG2 DEF MLDLS+4   => SYSTEM SEG 2 
SYSCA DEF SYSCD                                  [B]
SYSLA DEF SYSL
TAPEA DEF TAPER 
TMP2C DEF TEMP2 
TS0B  DEF TS0                                    [B]
WDLTB DEF WDLTE 
WEOOD DEF WEOOM 
WRSGA DEF WRSEG 
ELDSG EQU CM5      -#SEGMENT IN SST FOR EQT, LOADER 
*                                    & DIREC
      SKP 
* 
*  CHECK FOR PAGE OVERFLOW
* 
      LDA 6000B                                  [B]
      HED RELOAD AND SELECTIVE LOAD 
      ORG 10000B
* 
*      MAG TAPE RELOAD AND SELECTIVE LOAD SHARE THE 
* MAG TAPE FILE AND PROGRAM RECOVERY ROUTINES.
* 
FLRV  EQU * 
      CLA 
      STA SRFLG     SET FLAG FOR MAG TAPE RELOAD
      STA DCBVJ,I   SET AAA FLAG
      STA CUADT     START WITH DISC 0 
      STA CUDIR     SET DIRECTORY IN CORE TO NULL 
      STA MTRRJ,I   SAY NO RECORD IN BUFFER 
      LDA JLADQ     SET ID TABLE
      STA ENTEJ,I     TO NON-EXISTANT 
* 
      LDA JDECJ,I   GET THE COUNT 
      ADA JD2         OF ENTRIES
      STA JDECJ,I   UPDATE IT 
      SZA,RSS         AND SKIP RELOAD IF NO ENTRIES 
      JMP SPME
* 
*     THIS SECTION READS IN ALL OF THE DISC ADT'S.
* THEY REMAIN IN CORE UNTIL THE RECOVERY IS COMPLETE
* TO MINIMIZE DISC TRANSFERS. 
* 
      LDB JLADP     => FIRST AVAILABLE CORE BUFFER
      JSB SPDA      READ IN ALL OF THE ADTS 
* 
*      BEGINNING OF THE MAG TAPE RELOAD SECTION 
* 
SPDC  EQU * 
      JSB MTRDJ,I   CALL FOR FIRST RECORD 
      JMP SPEOS     END OF FILE MEANS END OF SET
      JMP SPEW      TAPE ERROR. PRINT MESSAGE 
      STA JTMP1     SAVE THE RECORD SIZE
      JSB DIRLK     SEE IF THE ENTRY IS IN THE DIR
      JMP SPDCE     NO, CHECK FOR ID IN TABLE 
      LDB DIRP      => DIRECTORY ENTRY
      ADB JD10      => RECOVERED FLAG 
      LDA B,I       HAS THE FILE BEEN 
      SZA             RECOVERED YET?
      JMP SPDCA     NO, GET IT
      JMP SPSFM     YES, SKIP IT
SPDCE EQU * 
      LDA ADJ0,I    CHECK FOR ID IN TABLE 
      JSB EFIDJ,I 
      JMP SPSFM     ID NOT IN TABLE, SKIP FILE
      JSB DRENJ,I   PUT FILE INTO DIRECTORY 
      JMP SPDG      NO ROOM IN THE DIRECTORY
SPDCA EQU * 
      LDA ADJ11,I   GET THE ENTRIES LENGTH
      STA JDTM4,I     AND SAVE IT 
      SKP 
* 
*      SEARCH THROUGH THE IN CORE ADT'S TO FIND A 
* LARGE ENOUGH PIECE OF DISC SPACE. 
* 
      LDA JM8 
      STA JTMP0     SET COUNT OF ADTS 
SPEAV EQU * 
      LDA CUADT     GET CURRENT ADT NUMBER
      CPA JD7         AND ADVANCE TO NEXT 
      CLA,RSS       ZERO FOLLOWS SEVEN
      INA 
      STA CUADT     SET NEW ADT NUMBER
      LDB SRFLG     CHECK FOR SELECTIVE LOAD
      SZB 
      JMP SPDEM     SELECTIVE LOAD
      LDB DCBS      GET ALTERNATE ALLOCATION FLAG 
      SSB,RSS         SKIP IF AAA TO BE USED
      JMP SPDES     USE NORMAL ALGORITHM
      DLD ADTBL+8   GET THE DISC ADDRESS
      DST INTMP     SAVE FOR SEARCH 
      CMB           NEGATE THE
      CMA             ADDRESS 
      DST DCBV      AND SAVE FOR FSDAD
      LDA JM9 
      STA JTMP5     SET A COUNTER 
      LDA JMHND     SET POINTER TO END OF MHAD
      STA CTMJ3,I 
      JSB CFTDJ,I   DO A SUBTRACTION
      SSB           SKIP IF OUT OF RANGE
      JMP SPDFB 
      HLT 31B       DIR IS MESSED UP
      JMP *-1 
SPDFB EQU * 
      LDA CTMJ3,I   MOVE THE
      ADA JM6         POINTER TO
      STA CTMJ3,I       PREVIOUS ENTRY
      JSB CFTDJ,I   AND SUBTRACT AGAIN
      ISZ JTMP5     INCREMENT COUNTER 
      SSB           SKIP IF FOUND 
      JMP SPDFB     OTHERWISE, LOOK ON PREVIOUS DISC
      LDA JTMP5     GET THE COUNTER 
      CMA           CONVERT TO POSITIVE 
      STA CUADT     SET THE ADT NUMBER
      IOR JASB0 
      STA AADNJ,I   SET THE ERROR MESSAGE 
      LDA CUADT     GET THE DISK NUMBER BACK
SPDES EQU * 
      MPY JB14H 
      ADA JLADQ     => CURRENT ADT BUFFER 
      JMP SPDEN 
      SKP 
* 
*      FOR SELECTIVE LOAD, THE ADTS CAN BE UP TO
* 8K LONG SO THEY HAVE TO BE READ IN EACH TIME. 
* 
SPDEM EQU * 
      ALS           MULTIPLY
      ADA CUADT       BY 3
      ADA DADLJ     => LENGTH WORD
      LDB A,I       GET THE 
      STB MWORD       LENGTH
      ADA JM2       => DISC ADDRESS 
      LDB IDTCJ 
      JSB DISCJ,I   READ IN THE ADT 
      CLA           TELL DIRGE THAT WE'VE WIPED 
      STA CUDIR       OUT ITS BUFFER
      STA DCBVJ,I   NOT ALTERNATE ALLOCATION
      LDA IDTBJ     => IDT BUFFER 
* 
SPDEN EQU * 
      STA DCADJ,I   SAVE FOR SEARCH ROUTINE 
      CCA           A _ -1
      STA DCFLJ,I   FLAG TO LEAVE SPACE IN ADT
      LDA ADJ11,I   GET THIS ENTRIES LENGTH 
      SSA,RSS 
      JMP SPEBA     BLOCK COUNT ALREADY 
      CCB 
      ASR 8         CONVERT WORD COUNT TO 
      CMA,INA         POSITIVE BLOCK COUNT
SPEBA EQU * 
      CLB           SET FOR 
      STB LTP1B,I     FSDAD 
      LDB CUADT     GET ADT NUMBER
      BLS           MULTIPLY
      ADB CUADT       BY 3
      ADB DADLJ     => LENGTH WORD
      DST JTMP5     SAVE FILE LENGTH AND ADT LENGTH PTR 
      JSB FSDAJ,I   CALL SPACE GETTER 
      RSS           NO ROOM IN THIS ADT 
      JMP SPEBE     FOUND 
      LDA DCBVJ,I   GET THE AAA FLAG
      SSA           SKIP IF NOT 
      JMP AAERJ,I   NO PIECE ON CORRECT DISC
      ISZ JTMP0     CHECK COUNTER 
      JMP SPEAV     WE HAVEN'T CHECKED ALL ADTS YET 
      SKP 
* 
*     THERE EXISTS NO SINGLE PIECE OF DISC SPACE
* LONG ENOUGH TO HOLD THE FILE CURRENTLY BEING
* READ.  PRINT AN ERROR MESSAGE AND DELETE THE
* ENTRY FROM THE DIRECTORY.  SCAN FOR AN END OF 
* FILE AND CONTINUE LOADING.
* 
* 
      JSB DIRLK     MUST GET THE DIR TRACK
      HLT 31B       TRACK HAS DISAPPEARED 
      LDA DIRP      => CURRENT ENTRY
      LDB MRIDJ     => ERROR MESSAGE
      JSB CFFWJ,I   CONVERT INTO ERROR MESSAGE
      LDA JD27      CHARACTER COUNT 
      LDB MRIEJ       AND ADDRESS FOR 
      JSB ASRJ,I        "NO ROOM FOR <ID><NAME> " 
      LDB DIRP      => CURRENT ENTRY
      STB MOVDJ,I   SET THE DESTINATION 
      ADB JD12
      STB MOVSJ,I     AND SOURCE
      ADB CUDIR,I   SUBTRACT THE LENGTH 
      ADB MIDTB       AND CALCULATE THE MOVE LENGTH 
      JSB MOVEJ,I   DELETE THE OFFENDING ENTRY
      LDA CUDIR,I     AND GENERATE
      ADA JD12          THE NEW 
      STA CUDIR,I         DIRECTORY LENGTH
      JSB CDTW      WRITE BACK THE UPDATED DIR TRACK
      LDA IDTBJ     UPDATE
      STA MOVSJ,I     THE 
      LDA CUDIR         DIREC 
      INA                 TABLE 
      STA MOVDJ,I 
      LDB JM4 
      JSB MOVEJ,I 
      ISZ JDECJ,I   CHECK THE NUMBER OF ENTRIES 
      JMP SPSFM     SEARCH FOR A FILE MARK
      LDA JLADQ     CHECK FOR MORE ENTRIES
      CPA ENTEJ,I     IN THE ID TABLE 
      JMP SPEOS     RELOAD IS DONE
      JMP SPSFM     CONTINUE FOR SELECTIVE LOAD 
* 
*      AN UNEXPECTED END OF FILE HAS BEEN READ. 
* PRINT A MESSAGE AND TRY TO GET THE NEXT ENTRY.
* 
SPEF  EQU * 
      LDA DIRP      => CURRENT ENTRY
      LDB MTUFX     => ERROR MESSAGE
      JSB CFFWJ,I   CONVERT INTO MESSAGE
      LDA JD44      GET CHARACTER COUNT 
      LDB MTUFW       AND ADDRESS 
      JSB ASRJ,I    "UNEXPECTED EOF. <ID><NAME> LOST" 
      CLA 
      STA CUDIR     NO DIR TRACK IN CORE
      JMP SPDC      TRY NEXT RECORD 
      SKP 
* 
*      A TAPE ERROR HAS OCCURRED.  WE WILL PRINT THE
* ERROR MESSAGE FOR THIS ENTRY AND CONTINUE ON. 
* 
SPEW  EQU * 
      LDA ADTBJ     => CURRENT BLOCK
      RSS 
SPEX  EQU * 
      LDA DIRP      => CURRENT ENTRY
      LDB MTAEW     => ERROR MESSAGE
      JSB CFFWJ,I   CONVERT INTO ERROR MESSAGE
      LDA JD30      CHARACTER COUNT 
      LDB MTAEJ       AND CORE ADDRESS FOR
      JSB ASRJ,I        "TAPE ERROR <ID><NAME> LOST"
      CLA 
      STA CUDIR     INDICATE NO DIR TRACK IN CORE 
* 
*      THE RELOAD OF THE CURRENT FILE CAME UP A BAG 
* OF WORMS.  SEARCH FOR THE FILE MARK TO RESTORE
* ORDER AND RESUME PROCESSING.
* 
SPSFM EQU * 
      JSB MTRDJ,I   CALL FOR READ 
      JMP SPDC      FILE MARK, FORGE ON 
      JMP SPSFM     TAPE ERROR . . . OH, BANANAS
      JMP SPSFM     GOOD RECORD. . . SO SKIP IT 
      SKP 
