
ASMB,A,B,C,L   2000F (OPTION 200) TSB LOADER
*                                  7900 DISC (VERSION B)
      ORG 2 
      HLT 2 
      JMP *-1 
      HLT 4,C       LOADER POWER FAIL HALT
      HLT 5         EVERYBODY HALTS ON PARITY ERRORS
      CLC 6B
A     EQU 0         A REGISTER = MEMORY LOCATION 0
B     EQU 1         B REGISTER = MEMORY LOCATION 1
CC    EQU 0         APPEARS WHERE COMMAND CHANNEL 
*                                   ADDRESS IS FILLED IN
CCHAN EQU 0         COMMAND CHANNEL DUMMY 
DC    EQU 0         APPEARS WHERE DATA CHANNEL
*                                   ADDRESS IS FILLED IN
DCHAN EQU 0         DATA CHANNEL DUMMY
CMND  EQU 0 
DATA  EQU 0 
DINT  EQU 0         TAGS INTERRUPT DISABLE
EINT  EQU 0         TAGS INTERRUPT ENABLE 
DMAH  EQU 6         HIGH DMA CHANNEL
DMAL  EQU DMAH-4    LOW DMA CHANNEL 
TTYSC EQU 12B       ASR35 SELECT CODE 
PHRSC EQU 13B       PHOTOREADER SELECT CODE 
BSDAT EQU 15B 
BSCOM EQU BSDAT+1   COMMAND CHANNEL OF DISC 0 
* 
      ORG BSDAT 
      HLT 15B 
      HLT 16B 
      HLT 17B       COMMAND CHANNEL 
      HLT 20B 
      HLT 21B         LOCATIONS OF
      HLT 22B 
      HLT 23B           DISCS WILL BE 
      HLT 24B 
      HLT 25B             REPLACED WITH 
      HLT 26B 
      HLT 27B               <JSB DISCB,I> 
      HED EQUIPMENT TABLE 
      ORG 100B
* 
EQTB  EQU * 
IDEC  BSS 12        ID TABLE HEADERS
*                                   EACH ENTRY IS 4 WORDS LONG
*                                   AND CONSISTS OF 
*                                   1) FIRST ID ON TRACK
*                                   2) DISC 
*                                   3)   ADDRESS
*                                   4) LENGTH IN -WORDS 
* 
NIDT  BSS 1         NUMBER OF ID TRACKS 
NDIRT BSS 1         NUMBER OF DIRECTORY TRACKS/DISC 
DADLC BSS 24        DISC ADT DESCRIPTERS
*                                   EACH ENTRY IS 3 WORDS LONG
*                                   AND CONSISTS OF 
*                                   1) DISC 
*                                   2)   ADDRESS
*                                   3) LENGTH IN -WORDS 
DADLN EQU DADLC+2   LOGICAL DISC 0'S ADT LENGTH 
* 
DKTBL BSS 8         DISC SELECT CODE / UNIT TABLE 
DSLLC BSS 2         DISC ADDR OF SYSTEM LIBRARY 
DSLLN BSS 1         LENGTH OF SYS LIBRARY IN + BLOCKS 
SYSID BSS 5         SYSTEM IDENTIFICATION 
MAGSC BSS 1         MAG TAPE SELECT CODE
NPORT BSS 1         -NUMBER OF AVAILABLE PORTS
YEAR  BSS 1         YEAR
DATE  BSS 1         HOUR OF YEAR
TIME  BSS 1         TENTHS OF SECONDS 
HDATE BSS 1         LAST HIBERNATE DATE 
SLEPT BSS 1         SYSTEM SLEPT FLAG  0 = SLEPT
EQTND EQU *         END OF THE EQT
* 
LDBSA DEF FBINI     => FINAL DISC BOOTSTRAP 
LSTDA DEF MLTLC     => LOADER PORTION OF SST
* 
MHAD  DEF MHTBL     ADDRESS OF M. H. DISC TABLE 
GMQBP DEF GMQBD     ROUTINE TO PROVIDE MESSAGE BUFFR
DISCA DEF MDISC     ADDRESS OF DRIVER ENTRY 
DISCB DEF MDINT     ADDRESS OF INTERRUPT ENTRY
MBUSY OCT 0         DRIVER BUSY FLAG
MWORD BSS 1         REQUESTED WORD COUNT
DREDP DEF DREDY     POINTER TO DISC RESTART WAITER
EQTSE EQU *         END OF THE EQT DISK SEGMENT 
      HED NORMAL LOADER ENTRY POINT 
*                        *
**  NORMAL ENTRY POINT  **
*                        *
      ORG 2000B 
* 
      JMP *+1,I     NORMAL ENTRY
      DEF LDR         POINT 
      SPC 4 
*                                 * 
**  LOADER-SYSTEM LINKAGE TABLE  ** 
*                                 * 
* 
*  CONTENTS FILLED IN FROM TSB SYSTEM TAPE ON PAPER TAPE LOADS, 
*  FROM MAG TAPE ON MAG TAPE LOADS. 
* 
LSLTB EQU * 
LIBRA BSS 1         SYSTEM LIBRARY PROGRAM ORIGIN 
COM6  BSS 1         ADDRESS OF SYSTEM LIBRARY DISC
*                                     ADDRESSES 
INCRE BSS 1         LENGTH OF TTY TABLE 
TTYDA BSS 1         ADDRESS OF USER DISC ADDRESS
?ID   BSS 1         ADDRESS OF ID-NAME
SWPIA BSS 1         ADDRESS OF USER-DEPENDENT ITEMS 
SWPLN BSS 1         LENGTH OF SWAP AREA 
SWPAA BSS 1         CORE ADDRESS OF SWAP AREA 
TSB   BSS 1         SYSTEM STARTING ADDRESS 
PWRFL BSS 1         POWER FAIL INTERRUPT CODE 
GMQBN BSS 1         GET MESSAGE BUFFER
SYSLT BSS 1         NO. OF SYSTEM LIBRARY PROGRAMS
LSLTE EQU * 
      HED ASR35 DRIVER
* 
*  UPON ENTRY (A) HOLDS THE NUMBER OF CHARACTERS TO BE OUTPUT OR
*  IS ZERO TO REQUEST INPUT.  FOR OUTPUT REQUESTS (B) POINTS TO 
*  THE FIRST WORD OF THE BUFFER.  A LINE FEED, RUBOUT, NULL, OR 
*  X-OFF IS IGNORED BY INPUT.  ON INPUT A CARRIAGE RETURN ENDS THE
*  RECORD, A '_' BACKSPACES ONE CHARACTER, AND A CONTROL-X
*  DELETES THE INPUT RECORD.
* 
TTY35 NOP 
      STA CCNTY     SET CHARACTER COUNT 
      SZA,RSS       OUTPUT REQUEST? 
      JMP TTY6      NO
      BLS           YES, INITIALIZE 
      STB BUFAD       CHARACTER POINTER 
      CCA           SET FLAG
      STA TFLAG       AS 'OUTPUT' 
      LDA B120K     SEND BITS FOR 
      OTA TTYSC       'PRINT ONLY'
TTY1  LDA CCNTY     ALL CHARACTERS
      SZA,RSS         OUTPUT? 
      JMP TTY35,I   YES 
      ADA NM1       NO, CORRECT 
      STA CCNTY     CHARACTER COUNT 
      LDB BUFAD     COMPUTE 
      ISZ BUFAD       WORD-CHARACTER
      CLE,ERB           ADDRESS 
      LDA 1,I       LOAD WORD 
      SEZ,RSS       POSITION
      ALF,ALF         CHARACTER 
      AND DB177     EXTRACT CHARACTER 
      IOR NB200     ADD IN BIT 7
      OTA TTYSC     OUTPUT IT 
TTY2  STC TTYSC,C   REQUEST CHARACTER TRANSFER
      SFS TTYSC     WAIT FOR
      JMP *-1         COMPLETION FLAG 
      LDA TFLAG 
      SZA           OUTPUT? 
      JMP TTY1      YES 
      LIA TTYSC     NO, EXTRACT 
      AND DB177       CHARACTER 
      CPA DB12      LINE FEED?
      JMP TTY2      YES 
      CPA DB177     NO, RUBOUT? 
      JMP TTY2      YES 
      SZA           NO, NULL
      CPA NB23        OR X-OFF
      JMP TTY2      YES 
      CPA BKSPC     NO, '_' ? 
      JMP TTY4      YES 
      CCB           NO
      CPA CTLX      EXIT ON CONTROL X 
      JMP TTY5
      STA TTYTM     SAVE CHARACTER
      LDB CCNTY     BACKSPACE 
      CPB D.72        IF BUFFER 
      JSB BKSP          IS FULL 
      LDB BUFAD     COMPUTE 
      ISZ BUFAD       NEXT BUFFER 
      CLE,ERB           ADDRESS 
      SEZ,RSS       POSITION
      ALF,SLA,ALF     AND FORM
      IOR 1,I           BUFFER WORD 
      STA 1,I       STORE AND 
      ISZ CCNTY       COUNT CHARACTER 
      LDA TTYTM     WAS IT A
      CPA NB15        CARRIAGE RETURN?
      JMP TTY35,I   YES 
      JMP TTY2      NO
TTY4  JSB BKSP      BACKSPACE 
      JMP TTY2
TTY5  STB TFLAG     SET TO OUTPUT MODE
      ADB TTY35     SET RETURN
      STB TTY35       TO INPUT CALL 
      LDA N.3       OUTPUT '\' AND
      LDB RVRSA       CARRIAGE RETURN - 
      JMP TTY35+1       LINE FEED 
TTY6  LDB IBUFA     SET UP INPUT
      STB BADRA,I     BUFFER
      STB BUFAD         POINTERS
      STA TFLAG     SET TO INPUT MODE 
      LDA B160K     SEND INPUT BITS 
      JMP TTY2-1      TO ASR 35 
      SPC 2 
*                             * 
**  BACKSPACE ONE CHARACTER  ** 
*                             * 
BKSP  NOP 
      LDB CCNTY     DECREMENT 
      SZB,RSS         CHARACTER 
      JMP BKSP,I        COUNT 
      ADB NM1             IF
      STB CCNTY             NON-ZERO
      CCB           BACKSPACE 
      ADB BUFAD       CHARACTER 
      STB BUFAD         ADDRESS 
      CLE,ERB       INSURE
      LDA 1,I         NEXT CHARACTER
      AND HIMSK         WILL NOT BE 
      STA 1,I             GARBLED 
      LDA TTYTM     RETRIEVE CHARACTER FOR CALLS
      JMP BKSP,I      FROM BUFFER OVERFLOW
      HED DISC DRIVER DRIVER
* 
*        THIS ROUTINE ENABLES THE INTERRUPTS, CALLS THE 
*     REAL DISC DRIVER, AND WAITS FOR THE TRANSFER
*     TO BE COMPLETED.  IF THE DISC DRIVER GENERATES ANY
*     ERROR MESSAGES, THE LAST OF THEM IS PRINTED.
*     THE DRIVER DISABLES THE INTERRUPT SYSTEM AGAIN
*     WHEN IT IS DONE.
*        A SUCCESSFUL TRANSFER RETURNS TO (P+1) AFTER 
*     CLEARING DSERF.  IF A DISC ERROR OCCURS, DSERF=0
*     IMPLIES AN APPROPRIATE HALT (NORMAL CASE).  IF A
*     DISC ERROR OCCURS WHEN DSERF<>0, DISCZ CLEARS 
*     DSERF AND RETURNS TO (P+2). 
* 
* 
DISCZ NOP 
      CLC TTYSC     CLEAR INTERRUPT ON CONSOLE TTY. 
      CLC PHRSC     CLEAR INTERRUPT ON PHOTOREADER
      STA GMQBF+1   SAVE A
      CLA           SET MESSAGE LENGTH TO 
      STA GMQBF       INDICATE NO MESSAGE 
      LDA GMQBF+1   RESTORE A 
      JSB DISCA,I   CALL NORMAL DRIVER
      HLT 30B       DRIVER BUSY 
      JMP DISZ2     DISC NOT PRESENT             [B]
      LDA MBUSY     WAIT FOR COMPLETION 
      SSA           -1 SEZ BUSY 
      JMP *-2 
      CLF DINT      INTERRUPTS OFF FOR NORMAL LOAD
      LDA GMQBF     MESSAGE LENGTH
      SZA,RSS       SKIP IF THERE IS A MESSAGE
      JMP DISZA     NO MESSAGE, JUST RETURN 
      CLA,INA       CHAR COUNT FOR A LINE FEED
      LDB PTRLF     => A LIKELY LINE FEED 
      JSB TTY35 
      LDA GMQBF     GET THE CHARACTER COUNT 
      LDB GMQBG     BUFFER POINTER
      JSB TTY35     OUTPUT THE ERROR MESSAGE
      CLA,INA       CHAR COUNT FOR ONE CR 
      LDB NCRA      => CARRIAGE RETURN
      JSB TTY35     OUTPUT IT 
* 
DISZA EQU * 
      LDA MBUSY 
      SZA           0 SAYS NO ERRORS
      JMP DISZ3     1,2, OR 3 ARE ERROR CODES    [B]
DISZ1 STA DSERF     CLEAR DISC 'SOFT FAIL' FLAG 
      JMP DISCZ,I 
* 
DISZ2 CLF DINT      TURN INTERRUPTS OFF          [B]
      LDA DSERF     SOFT
      SZA             FAIL? 
      JMP DISZ4     YES, KEEP HOPING
      HLT 31B       NO DISC,
      JMP *-1         NO HOPE 
      SKP 
DISZ3 LDA DSERF     SOFT                         [B]
      SZA             FAIL? 
      JMP DISZ4     YES, STUMBLE ON 
      HLT 32B       NO, 
      JMP *-1         CHECK OUT 
* 
DISZ4 CLA           CLEAR 'SOFT FAIL' FLAG       [B]
      ISZ DISCZ     SET RETURN
      JMP DISZ1       TO (P+2)
      SPC 3 
* 
*  HANDLE SOFT DISC ERROR WHEN WRITING SYSTEM TABLES TO DISC
*  DURING SLEEP OR HIBERNATE. 
* 
DISCY EQU * 
      LDA N.28
      LDB DSRLA     PRINT DISC RELOAD 
      JSB TTY35       IMPOSSIBLE MESSAGE
      LDA MAGSC     IS THERE A MAG TAPE UNIT
      SZA             ON THIS SYSTEM? 
      JMP MTDPA,I   YES - GO MAG TAPE DUMP
      JSB GMTSA,I   GET MAG TAPE SELECT CODE
      RSS           NO SEL CODE 
      JMP MTDPA,I   GOT SEL CODE - GO DUMP
      HLT 32B 
      JMP DISCY     ASK AGAIN 
      HED CONSTANTS, TEMPORARIES, ETC.
NM1   DEC -1
N.3   DEC 3 
N.28  DEC 28
DB12  OCT 12
NB15  OCT 15
NB23  OCT 23
D.72  DEC 72
DB177 OCT 177 
NB200 OCT 200 
BKSPC OCT 137 
CTLX  OCT 30
B120K OCT 120000    'PRINT ONLY' TTY CONTROL BITS 
B160K OCT 160000    'INPUT' TTY CONTROL BITS
HIMSK OCT 177400
RVRSL OCT 56015,5000 '\ CR LF' FOR LINE DELETION
* 
DSERF OCT 0         DISC 'SOFT FAIL' FLAG 
CCNTY BSS 1 
INBUF BSS 36        TTY INPUT BUFFER
GMQBF BSS 39        DISC ERROR MESSAGE BUFFER 
BUFAD BSS 1         TTY CHARACTER ADDRESS 
TFLAG BSS 1         TTY I/O MODE
TTYTM BSS 1         TTY TEMPORARY 
IBUFA ABS INBUF+INBUF 
DSRLA DEF DSRL
RVRSA DEF RVRSL 
BADRA DEF BADDR     ADDRESS OF CHARACTER POINTER
PTRLF DEF ENPID     => A LINE FEED
GMQBG DEF GMQBF+1   => MESSAGE
GMTSA DEF GMTS
MTDPA DEF MTDMP 
NCRA  DEF NCR 
* 
      SUP 
DSRL  OCT 6412      CR - LF 
      ASC 12,DISC RELOAD NOT POSSIBLE 
      OCT 6412
ENPID OCT 5116      LF - N
      ASC 5,O SUCH ID 
NCR   OCT 6412      CR-LF 
ENQEP OCT 5105      LF - E
      ASC 10,NTRY ALREADY PRESENT 
      OCT 6412      CR - LF 
ENQNE OCT 5116      LF - N
      ASC 6,O SUCH ENTRY
      OCT 6412      CR - LF 
ENTNA OCT 5105      LF - E
      ASC 8,NTER NAME LIST, 
      ASC 7,ONE PER LINE; 
      ASC 10,TERMINATE WITH 'END' 
      OCT 6412      CR - LF 
MTBTL OCT 5102      LF - B
      ASC 6,AD TAPE LABE
      OCT 046015    L - CR
MTUFM OCT 5125      LF - U
      ASC 12,NEXPECTED END OF FILE. 
MTUFN BSS 6 
      ASC 2, LOS
      OCT 52015     T - CR
RLMS  OCT 5114      LF - L
      ASC 11,OAD OR DUMP COMMANDS?
TCHA  OCT 5101      LF A
      ASC 17,RE YOU SURE THAT'S TODAY'S DATE? 
LQAA  OCT 5101      LF A
      ASC 14,LTERNATE ALLOCATION OPTION?
NTSE  OCT 6412                                   [B]
      ASC 9,SYSTEM NOT SLEPT; 
      ASC 12,MUST RELOAD FROM MAG TAPE
      OCT 42415 
      OCT 5012
SUPM  OCT 5116                                   [B]
      ASC 9,O ROOM IN DIRECTORY 
      OCT 54415 
      UNS 
      SPC 3 
* 
*      THE FOLLOWING INSTRUCTION EXISTS SOLELY TO GET 
* AN OVERFLOW DIAGNOSTIC IF THE ENTRY AT 3000B WILL 
* OVERLAY ANY OF THIS CODE. 
* 
      LDA *+1000B 
      HED RESUSITATION ENTRY POINT
*                                  *
**  NON-SLEEP RELOAD ENTRY POINT  **
*                                  *
      ORG 3000B 
* 
      CLC 0,C 
      JMP *+1,I 
      DEF RESU
      SPC 4 
TLRT  EQU *         FIRST TAPE LABEL BUFFER 
      BSS 1         ASC 1,LB
      BSS 1         ASC 1,TS
TLBE  EQU *-TLRT    BEGIN/END 
      BSS 1 
TLRN  EQU *-TLRT    REEL NUMBER 
      BSS 1 
TLYR  EQU *-TLRT    YEAR
      BSS 1 
TLD1  EQU *-TLRT    HOUR
      BSS 1 
TLD2  EQU *-TLRT    TENTHS OF SECONDS 
      BSS 1 
TLSL  EQU *-TLRT    SYSTEM AND FEATURE
      BSS 2           LEVEL CODES 
TLEN  EQU *-TLRT
* 
TLRV  BSS TLEN      BUFFER FOR SUBSEQUENT TAPE LABELS 
      BSS 1         EXTRA WORD OF BUFFER
* 
MTRLT BSS 256       SYSTEM SEGMENT TABLE BUFFER 
      SPC 3 
* 
*  CHECK FOR PAGE OVERFLOW
* 
      LDA 2000B                                  [B]
      HED MAIN SEQUENCE 
*                           * 
**  MAIN LOADING SEQUENCE  ** 
*                           * 
* 
*  BEGIN HERE FOR NORMAL LOADING SEQUENCES. 
* 
      ORG 4000B 
* 
LDR   CLC 0,C       SET I/O TO NULL STATE 
      CLB 
      STB MBUSY     CLEAR DISC BUSY FLAG
      LDA EQTLN     ZERO OUT
      STA TEMP0 
      LDA EQTA        ENTRIES 
LDR2  EQU * 
      STB A,I           OF THE
      INA 
      ISZ TEMP0           EQUIPMENT TABLE 
      JMP LDR2
      LDA DIRLN     ZERO
      STA TEMP0 
      LDA DIRCA       DIREC 
LDR3  EQU * 
      STB A,I 
      INA               TABLE 
      ISZ TEMP0 
      JMP LDR3
      LDA BSDTA     SET 
      STA TEMP2       FOR 
      STB TEMP1         DISC
      STB TEMP3           0 
      JSB STDIA,I 
      LDA M24       SET DIRECTORY LENGTH
      STA DIRCA,I     FOR TWO DUMMY ENTRIES 
      LDA B40 
      STA BLNKA,I   SKIP BLANKS 
LDR4  LDA .12       ASK 
      LDB LBRYA 
      JSB ASR35,I     IF LIBRARY
      CLA 
      JSB ASR35,I       EXISTS
      JSB GETCA,I   ANSWER GIVEN? 
      JMP ERR1      NO
      CPA Y         YES, 'Y' ?
      JMP LDR7      YES, ASSUME 'YES' 
      CPA N         NO, 'N' ? 
      JMP LDR1      YES, ASSUME 'NO'
* 
ERR1  LDA .15       NO
      LDB ILINA     TRY 
      JSB ASR35,I     AGAIN 
      JMP LDR4
      SKP 
*                       * 
**  SYSTEM GENERATION  ** 
*                       * 
* 
*  CREATE NASCENT EQUIPMENT TABLE.
* 
LDR1  EQU * 
      CCB 
      STB MTFLG     SET FLAG TO 'SYSGEN' MODE 
      LDA M5        SET 
      STA TEMP0 
      LDB DSYID       SYSTEM
      LDA ASC           ID
      STA 1,I 
      INB                 TO
      ISZ TEMP0 
      JMP *-3               BLANKS
      LDB M32       DEFAULT FOR 
      STB NPORT       NUMBER OF PORTS 
      LDB DNDTA,I   DEFAULT FOR 
      STB NDIRT       NUMBER OF DIR. TRACKS/DISC
      CLB,INB       DEFAULT FOR 
      STB NIDT        NUMBER OF ID TRACKS 
      JMP LDR75 
      SKP 
*                            *
**  INITIATE SYSTEM UPDATE  **
*                            *
* 
*  PRIMARY USE IS FOR LINKING A NEW SYSTEM (FOR EXAMPLE, A
*  SYSTEM UPDATE) WITH THE LIBRARY OF A CURRENT SYSTEM. 
* 
LDR5  EQU * 
      LDA SSTLN     GET THE SST LENGTH
      STA MWORD       AND SET FOR DISC DRIVER 
      LDB SSTLC     CORE LOCATION 
      LDA BSDAD       AND DISC ADDRESS
      JSB DISCC,I   READ IN SYSTEM SEGMENT TABLE
* 
      LDA EQTLN 
      STA MWORD     SET THE LENGTH
      LDB EQTI
      LDA CMLE      => DISC ADDRESS 
      JSB DISCC,I   READ IN EQUIPMENT TABLE 
* 
      DLD MLTBF 
      STA MWORD     SAVE THE LENGTH 
      ADB BIT15     SET INPUT BIT 
      LDA CMLF      => DISC ADDRESS 
      JSB DISCC,I   READ IN THE DIREC TABLE 
* 
      JSB JDSE      FIX UP DISC LINKS 
* 
      JSB RCOPA,I   REQUEST CONFIGURATION OPTION
      RSS           NOT WANTED. 
      JSB RNPRT     ASK # PORTS 
      CLA           SET FLAG TO 
      STA MTFLG       'SYSTEM UPDATE' MODE
      JMP KDSCA,I   NOW LOAD THE PAPER TAPE 
      SKP 
*                              *
**  INITIATE MAG TAPE RELOAD  **
*                              *
LDR7  EQU * 
      JSB GMTS      GET MAG TAPE SELECT CODE
      JMP LDR5      NONE GIVEN, DO SYSTEM UPDATE
      JSB TPLR      READ TAPE LABEL 
* 
      LDA TLSLA,I   IS THE SYSTEM LEVEL CODE ON TAPE
      CPA SYSCD       SAME AS THAT IN LOADER?    [B]
      RSS           YES 
      JMP ILSIA,I   NO, ABORT LOAD
* 
      LDA EQTLN     READ THE
      LDB EQTA        EQUIPMENT TABLE 
      JSB MTAPE,I       FROM
      OCT 0               MAG TAPE
      JMP EOFRA,I 
      JMP TPERA,I 
      LDA MTFLG     RESTORE NEW 
      STA MAGSC       SELECT CODE 
      LDA IDEC+3    GET THE CURRENT 
      ADA IDEC+7      ID TABLE SIZE 
      ADA IDEC+11 
      STA JDECK     SAVE TOTAL LENGTH OF ID TABLE 
      SPC 3 
* 
*    ZERO OUT THE IDEC TABLE AND DISC ADT TABLE 
* 
      LDA M12       LENGTH OF IDEC TABLE
      STA TEMP0 
      LDB IDECA     => FIRST ENTRY
      CLA 
      STA NOMSB,I   CLEAR FLAG FOR MESSAGE
JDSDP EQU * 
      STA B,I 
      INB 
      ISZ TEMP0 
      JMP JDSDP 
* 
      LDB M24       LENGTH OF COMBINED ADT
      STB TEMP0       LENGTH AND ADDRESS TABLES 
      LDB DALCA     => LOWER TABLE
JDSDT EQU * 
      STA B,I 
      INB 
      ISZ TEMP0 
      JMP JDSDT 
* 
      JSB JDSE      SET UP DISC INTERRUPT LOCATIONS 
      SKP 
* 
*      READ IN THE DIREC TABLE AND COUNT THE NUMBER OF ENTRIES
* IN THE DIRECTORY
* 
      LDA DIRLN     = LENGTH
      LDB ADTBI     => BUFFER 
      JSB MTAPE,I 
      OCT 0 
      JMP EOFRA,I 
      JMP TPERA,I 
      CLA           SET THE COUNT TO ZERO 
      STA JDECN 
      LDA M80       SET THE COUNT OF DIRECTORY TRACKS 
      STA TEMP0 
      LDA ADTBI     GET A POINTER TO THIS BUFFER
JDSFC EQU * 
      STA TEMP1 
      LDA TEMP1,I   GET WORD COUNT OF THIS TRACK
      SZA,RSS       CHECK FOR EMPTY TRACK 
      JMP JDSFD     EMPTY, SKIP COUNT 
      CCB 
      DIV .12       TURN INTO ENTRY COUNT 
      ADA JDECN       AND ACCUMULATE
      STA JDECN 
JDSFD EQU * 
      LDA TEMP1     ADVANCE 
      ADA .7          POINTER 
      ISZ TEMP0         AND CHECK COUNT 
      JMP JDSFC 
* 
*  REQUEST CONFIGURATION OPTIONS
* 
      JSB RCOPA,I   REQUEST CONFIGURATION OPTIONS 
      JMP LD200     NOT WANTED
      SKP 
