* 
* GETID SCANS THE INPUT BUFFER FOR AN ID NUMBER. IF NOT FOUND, IT 
* OUTPUTS A MESSAGE AND TERMINATES. 
* IF FOUND, THE RESULT IS PLACED IN ID, -RESULT 
* IN MID. IF THE FOLLOWING CHARACTER IS A CR, GETID SKIPS ON THE
* WAY BACK. IN ANY CASE, THE NEXT CHARACTER IS IN A.
* GETID USES LTEMP+12,13,14,15. 
* 
GETCH EQU LTEMP+12
GETI1 EQU LTEMP+13
GETI2 EQU LTEMP+14
GETI3 EQU LTEMP+15
GETID NOP 
      LDA MLINK+1   DETERMINE WHICH SCANNER TO USE
      LDB DLCHR     USE LCHAR IF USER TELETYPE, 
      CPA T35LN       T35CH IF SYSTEM.
      LDB T35CH 
      STB GETCH HQ
      JSB GETCH,I   SCAN INPUT BUFFER FOR FIRST 
      JMP GTFER      CHARACTER. 
      ADA M133B     TEST FOR LETTER.
      SSA,RSS 
      JMP GTFER 
      ADA .+32B 
      SSA,INA 
      JMP GTFER 
      ASL 101o
      STA GETI1     SAVE FOR LATER. 
      LDA .-3       SET DIGIT 
      STA GETI2      COUNTER. 
      CLB           SET NUMBER
GETI4 STB GETI3      TO 0.
      JSB GETCH,I   GET NEXT CHAR.
      JMP GTFER     FAIL. 
      ADA M72B      TEST FOR DIGIT
      SSA,RSS 
      JMP GTFER     FAIL. 
      ADA .+10
      SSA 
      JMP GTFER     FAIL. 
      LDB GETI3     GET PARTIAL VALUE.
      RBL,RBL       MULTIPLY BY 10. 
      ADB GETI3 
      RBL 
      ADB 0         ADD IN NEW DIGIT. 
      ISZ GETI2     TEST FOR DONE.
      JMP GETI4 
      ADB GETI1     MERGE IN LETTER.
      STB ID
      CMB,INB 
      STB MID 
      JSB GETCH,I   GET NEXT CHARACTER. 
      ISZ GETID     SKIP RETURN IF CR.
      JMP GETID,I 
* 
GTFER LDA GETCH     IF SYSTEM TELETYPE, PRINT 
      CPA T35CH     ERROR MESSAGE THERE.
      JMP LFRER 
ILFER LDA .-9       OTHERWISE PRINT IT ON 
      LDB LFRDF     USER TELETYPE.
LIBER JSB LTYPE E
      JMP SCHEN,I   TERMINATE.
DLCHR DEF LCHAR 
* THIS ROUTINE IS CALLED BY THE COMPILER WHEN IT WANTS TO EXECUTE 
* A DISC ROUTINE. THE DISC TOUTINE IS ALWAYS EXECUTED WITH A PRIOTI-
* TY OF 0, AS ALL DISC ROUTINES ARE. THE CALLING SEQUENCE IS
*     JSB SCHLB,I 
*     DEF <DISC ADDRESS OF ROUTINE> 
*     <PARAMETERS IF DESIRED> 
*     <RETURN>
* 
SCHLQ NOP 
      CLF 0 
      LDB MLINK+1 
      ADB .-?LINK+?MASK 
      LDA MPCOM    SUSPEND
      AND 1,I        IF HE TRIED
      SZA    TO ABORT 
      JMP LLEND-1,I 
      ADB .-?MASK+?TSTA 
      LDA 1,I      SET UNABLE 
      IOR UNABT      TO ABORT 
      STA 1,I          BIT
      ADB .-?TSTA+?PLEV 
      CLA A*
      STA TIMEF     NO TIMING.
      STA 1,I       SET PRIORITY TO 0 
      ADB .+?STAT-?PLEV SET STATUS TO SYNTAX
      LDA %SYNT      SO SCHEDULER DOESN'T KNOW
      STA 1,I        WHAT WE'RE DOING.
      ADB .+?PROG-?STAT 
      LDA PBPTR     SET PBPTR IN TABLE. 
      STA 1,I 
      CMA           SET UP DISC 
      ADA USE        PARAMETERS.
      STA WORD
      ADB .+?DISC-?PROG 
      LDA 1,I 
      LDB USE       OUTPUT USER TO
      JSB DISCL      DISC.
      LDA SCHLQ,I   GET DISC ADDRESS. 
      ISZ SCHLQ 
      CPA LIB       IF IN CORE, TRANSFER DIRECT.
      JMP LIBRA 
      STA LIB       SET LIB.
      LDA 0,I 
      LDB M256      SET UP DISC TRANSFER. 
      STB WORD
      LDB #LIBI I)
      JSB DISCL 
      JMP LIBRA 
* 
* PROGRAM ALWAYS RETURNS HERE.
* qq
SCHBL CLF 0 
      LDB MLINK+1   SET PRIORITY AND STATUS 
      INB           AGAIN.
      ISZ 1,I       PRIORITY=1. 
      ISZ TIMEF     SET FLAG FOR TIMING.
      ADB .-2 
      ISZ 1,I       TRUE STATUS IS RUN. 
      STF 0 
      JMP SCHLQ,I 
HELK  DEF *+1 
      OCT 5111
      ASC 5,LL ACCESS 
HELH  DEF *+1 
      OCT 5116
      ASC 6,O TIME LEFT 
* *q
*     THIS SUBROUTINE INSERTS A USER INTO THE QUEUE IN ORDER OF HIS 
*     PRIORITY. WHEN WE ARRIVE HERE, THE B REGISTER POINTS TO THE LINK
*     WORD FOR THE USER.
* 
INSEQ NOP Pq
      STB SCHL     SAVE LINK ADDRESS IN SCHL
      INB          B=> USERS PRIORITY 
      LDA 1,I      A=PRIORITY 
      CMA          STORE -1-PRIORITY
      STA SCHPR      IN SCHPR.
      LDB MLINK    B=> PHONY USER.
SCH2  STB SCHP     SAVE SCHP. .>
      LDB 1,I      B POINTS TO NEXT USER. 
      LDA 1        GET PRIORITY 
      INA           THAT USER IN
      LDA 0,I      A. 
       ADA SCHPR   COPMPARE WITH PRIORITY 
      SSA          OF USER BEING INSERTED.
      JMP SCH2     IF >= GO TO LINK TO NEXT ENTRY.
      STB SCHL,I   SET NEW ENTRY TO POINT TO HIM. 
      LDA SCHL
      STA SCHP,I   SET PREVIOUS ENTRY => NEW ENTRY
      ADA .+?CLOC-?LINK    SET NEW USERS CLOCK TO -10.
      LDB .-10
      STB 0,I 
      JMP INSEQ,I 
* 
*  CHECK IF THE PROGRAM WHICH HAS JUST BEEN LOADED FROM THE USER
*  LIBRARY IS SEMI-COMPILED, AND SET THE NECESSARY COMPILER 
*  VARIABLES.  LIBSC, LIBSP, AND LIBPB ARE PASSED TO THIS ROUTINE 
*  FROM THE LIBRARY ROUTINE WHICH CALLS IT (CHAIN, GET, OR HELLO) 
* 
SEMIC NOP 
      CLF 0 
      CLA           NO--CLEAR OUT-OF- 
      STA SYMTB       STORAGE FLAG
      LDA LIBPB     SET LENGTH
      STA PBPTR       POINTER 
      LDB MLINK+1   SET 
      ADB .-?LINK+?MASK  SET TO           X]
      LDA 1,I            UNCOMPILED MODE  X]
      CMA                                 X]
      AND CFLAG                           X]
      STA CFLAG                           X]
      ADB .-?MASK                               [X] 
      STB MAIN        MAIN
      LDB LIBSP     SET START-OF- 
      STB SPROG       PROGRAM POINTER 
      STF 0 0
      JMP SEMIC,I 
LIBPB EQU LTEMP+13  END OF PROGRAM POINTER (PBPTR) .
LIBSP EQU LTEMP+9   START OF PROGRAM POINTER
* 
* 
*     FIND SPACE ON DISC
* *q
*     THE ID IS IN LTEMP
*     ADT EL LENGTH IS IN LTEMP+9 
*     THE NUMBER OF SECOTRS REQUIRED IS IN LTEMP+13 
*     THE DISC ADDRES S POINTER IS IN LTEMP+8 
*     THE DISC ADDRESS IS IN LTEMP+6
*     THE DISC SPACE LEFT IS IN LTEMP+12
* 
* 
FDISC NOP 
      LDA ADLEN     READ ADT TABLE INTO CORE
      STA WORD
      LDA ADLOC 
      LDB LIBDI 
      JSB DISCL 
      LDA ADLEN    GET ADT LENGTH 
      ARS          DETERMINE ENTRY COUNT
      STA LTEMP+9  SAVE SOUNT 
      LDB LIBD     LOAD ADT ADDRESS 
      INB          POINT TO FIRST LENGTH
FD.1  LDA 1,I      LOAD LENGTH
      ADA LTEMP+13 ADD - REQUIRED LENGTH
      SSA,RSS      BIG ENOUGH?
      JMP FD.2     YES
      ADB .+2      NO - NEXT ENTRY
FD.4  ISZ LTEMP+9   DONE? 
      JMP FD.1     NO 
*     NO ROOM LEFT
FD.5  LDB *+3       LOAD ERROR MESSAGE
      LDA .-10
      JMP LIBER    OUTPUT ERROR MESSAGE 
      DEF *+1 
      OCT 5117
      ASC 4,VERLOAD 
* *q
FD.2  ADB .-1      GET DISC ADDRESS 
      STB LTEMP+8  SAVE DISC ADDRESS POINTER
      STA LTEMP+12 SAVE DISC SPACE LEFT 
      LDA 1,I      LOAD DISC ADDRESS
      STA LTEMP+6    & SAVE IT
      LDA LTEMP    IF ID=A000 
      CPA A000     THEN IT IS OK
      JMP FDISC,I   SO RETURN                     (D) 
      LDA LTEMP+6  LOAD DISC ADR. 
      AND DHMSK    GET HEAD AND DISC DRIVE BITS 
      CPA B100     JUST BIT 6?
      JMP FD.3      YES, SYSTEM DISC MAY NOT BE USED  (D) 
      JSB FDIRC     GET DIRECTORY ENTRY           (D) 
      LDB 0,I       GET 2ND TRACK LENGTH          (D) 
      ADA .-7       POINT TO FIRST TRACK LENGTH   (D) 
      ADB 0,I       ADD THEM                      (D) 
      ADB OVFL      IS SYSTEM TOO LARGE           (D) 
      SSB,RSS                                   (D) 
      JMP FDISC,I   NO, EXIT                      (D) 
FD.3  LDB LTEMP+8   YES, CONTINUE THE SEARCH      (D) 
      ADB .+3      GET NEXT ENTRY 
      JMP FD.4
* 
* 
OVFL  DEC 9104      SIZE OF DIRECTORY           (D) 
* 
*     ROUTINE TO COMPUTE THE ADDRESS OF THE 
*     BASE PAGE DIRECTORY ENTRY 
*     FOR A GIVEN DISC
* 
*     THE DISC ADDRESS IS IN LTEMP+6
* 
* 
FDIRC NOP 
      CLB 
      LDA LTEMP+6  LOAD DISC ADDRESS
      RAL          GET DISC DRIVE 
      AND .+1 
      MPY .+28     MULTIPLY BY 28 
      STA LTEMP+4  SAVE IT
      LDA LTEMP+6  GET HEAD BIT 
      AND B100
      SWP          IN THE B REGISTER
      SZB,RSS      CARTRIDGE? 
      LDA .+14     YES
      ADA LTEMP+4 
      ADA DIRD0    ADD BASE ADDRESS 
      ADA .+7      SECOND TRACK 
      STA LTEMP+4  SAVE IT FOR DLLOK
      STA LTEMP+14 SAVE IT FOR SUPERSAVE
      JMP FDIRC,I  RETURN 
* 
* 
* qq
DIRHD DEF *+1 
      OCT 5012
      ASC 20, ID    NAME    DATE  SUB  TR/SEC   LEN 
      ASC 2, FP 
DIRMS OCT 17400 
DIRFS ASC 1,@0
DTABI DEF DCNT,I
DIR0S ASC 1,0/
UPMS1 DEF UPMA1 
UPMS2 DEF UPAMS 
ILL   DEF *+1 
      OCT 5111      LF-I
      ASC 4,LL. DISC
PLDR2 DEF LDER2 
PLDR5 DEF LDER5 
NUSE5 BSS 16        NOT USED                     [E]
      HED LIBRARY SIZES 
* THIS TABLE IS USED BY THE TSB PAPER TAPE LOADER, THE SLEEP
* ROUTINE, AND THE MAG TAPE LOADER. IT CONTAINS THE LENGTHS OF
* ALL THE REMAINING LIBRARY ROUTINES, AND ENABLES THE LOADER TO 
* ALLOCATE THE MINIMUM NUMBER OF DISC SECTORS FOR EACH OF THEM. 
* THE TABLE IS WRITTEN ON THE DISC AS THE FIRST LIBRARY ROUTINE.
      SPC 1 
      ORG LIBRA 
      ABS LIBRA-$SLPL 
      DEC -128
      ABS LIBRA-$FLB
      ABS LIBRA-$CHN
      ABS LIBRA-$SAV
      ABS LIBRA-$$SAV    SAVE OVERLAY.
      ABS LIBRA-$GET
      ABS LIBRA-$APP
      ABS LIBRA-$HEL
      ABS LIBRA-$$HEL 
      ABS LIBRA-$BYE
      ABS LIBRA-$KIL
      ABS LIBRA-$REN
      ABS LIBRA-$NAM
      ABS LIBRA-$CAT
      ABS LIBRA-$CAT
      ABS LIBRA-$DEL
      ABS LIBRA-$TIM
      ABS LIBRA-$UDIS 
      ABS LIBRA-$MESS 
      ABS LIBRA-$PRO
      ABS LIBRA-$PRO
      ABS LIBRA-$OPE
      ABS LIBRA-$$OPE 
      ABS LIBRA-$LEN
      ABS LIBRA-$ECH
      ABS LIBRA-$REP
      ABS LIBRA-$DIR
      ABS LIBRA-$ROS                             B] 
      ABS LIBRA-$RES
      ABS LIBRA-$SPE
      ABS LIBRA-$POR
      ABS LIBRA-$CHA
*                                                                B] 
      ABS LIBRA-$ANN       ANNOUNCE           [X] 
      ABS LIBRA-$SLE
      ABS LIBRA-$$SLE                    [X]
      ABS LIBRA-$$$SL                    [X]
      ABS LIBRA-$NEW
      ABS LIBRA-$KID
      ABS LIBRA-$$KID 
      ABS LIBRA-$MOV
      ABS LIBRA-$$MOV     MOVE OVERLAY            [X] 
      ABS LIBRA-$$$MV 
      ABS LIBRA-$PUR
      ABS LIBRA-$$PUR 
*                                                                B] 
      ABS LIBRA-$PHO
      ABS LIBRA-$DN       DISC DOWN COMMAND       X]
      ABS LIBRA-$UP       DISC UP COMMAND         X]
      ABS LIBRA-$TSB
      ABS LIBRA-$PFRS 
      ABS LIBRA-$PFSW 
      REP 6 
      DEC -256
$SLPL EQU * 
      HED FUSS
* THE FUSS TABLE CONTAINS AN 8 WORD ENTRY FOR EACH PORT.
* THERE ARE 4 ENTRIES FOR EACH 8 WORDS.  EACH FILE ENTRY
* REQUIRES 2 WORDS: 
*      1. DISC ADDRESS OF THE FILE
*      2. LENGTH OF THE FILE IN SECTORS (BIT 15=1 IF READ ONLY) 
* 
      ORG LIBRA 
      REP 16
      OCT 0,0,0,0,0,0,0,0 
      HED FILES 
* THE FILES ROUTINE IS USED BY THE BASIC COMPILER TO PROCESS A FILES
* STATEMENT DURING PHASE II.  THE PURPOSE OF THE ROUTINE IS TO PRO- 
* VIDE THE COMPILER WITH INFORMATION ABOUT THE REQUESTED FILES. THIS
* INFORMATION CONSISTS OF THE FILE DISC ADDRESS AND THE FILE LENGTH.
* THE COMPILER PASSES PARAMETERS TO THE FILES ROUTINE AS FOLLOWS: 
* 
*     VALTB=>LENGTH WORD OF FILES STATEMENT.
*     FILTB=>BEGINNING OF TABLE AREA FOR FILE INFO. 
*     SCHLB,I=>FIRST POSSIBLE RETURN ADDRESS. 
* qq
* THE CALLING SEQUENCE TO THE FILES ROUTINE IS AS FOLLOWS:
* 
*     JSB SCHLB,I Io
*     DEF FILIB 
*     <ERROR EXIT FOR BAD FORMAT IN FILES STATEMENT>
*     <ERROR EXIT IF A FILE IS UNACCESSIBLE>
*     <ERROR EXIT IF PROGRAM OVERFLOW>
*     <NORMAL EXIT> 
      SPC 2 
      ORG LIBRA 
* 
      LDA FILBP 
      STA FLBUF     SAVE BUFFER POINTER.
      STA FLBFP 
      LDA .-5      SET COUNTER FOR MAX NUMBER    X] 
      STA FLBC1      OF FILES ALLOWED.
      CCA           SET POINTER TO
      ADA VALTB,I    LAST CHAR +1 OF
      ADA VALTB       FILES STATEMENT.
      RAL 
      STA FLBP
      LDA VALTB     INITIALIZE POINTER TO 
      INA 
      ALS 
      STA FLBCP      FILES STATEMENT. 
* 
FLB1  LDA .-3       SET FILC2 TO SAY 3 WORDS
      STA FLBC2      ALLOWED. 
      CLA 
      STA FLBCM     CLEAR COMMA FLAG. 
      STA FLB$
      JSB FLBCH     GET FIRST CHAR. 
      CPA .+44B     TEST FOR DOLLAR SIGN. 
      JMP FLB2
FLB5  CPA .+40B     BETTER NOT BE A BLANK.
      JMP FLB81     FAIL IF IT IS 
      ADA FLB$      PLACE $ FLAG ON FIRST CHAR. 
FLB3  ALF,ALF       POSITION ON LEFT
      STA FLBUF,I    AND STORE IN BUFFER. 
      JSB FLBCH     GET RIGHT CHARACTER 
      IOR FLBUF,I    AND PACK IN. 
      STA FLBUF,I 
      ISZ FLBUF     BUMP BUFFER POINTER.
      JSB FLBCH     GET NEXT CHARACTER. 
      ISZ FLBC2     TEST FOR END OF FILE NAME.
      JMP FLB3
* 
      CPA .+40B     IF END OF FILE NAME, CHAR MUST
      JMP FLB4       BE A BLANK.
      JMP FLB81     FAIL IF NOT 
* qq
FLB2  LDA B200      IF 1ST CHAR IS $, SET FIL$ TO 
      STA FLB$     INDICATE LIBRARY FILE
      JSB FLBCH     GET NEXT CHAR.
      JMP FLB5
* qq
FLB4  ISZ FLBC1     TEST FOR TOO MANY FILES.
      RSS 
      JMP FLB81 HHH^
      LDA FLBCM     TEST FOR ANY MORE REQUESTED.
      SZA 
      JMP FLB1      YES IF COMMA WAS SEEN.
* 
      LDA FLBC1     SET FILC1 TO EQUAL
      ADA .+5       -# OF FILES REQUESTED           [X] 
      CMA,INA 
      STA FLBC1 
      STA FLBC2 
* 
      ISZ SCHLQ     BUMP RETURN ADDRESS SINCE WE'VE 
      LDA FLBFP      NOW CHECKED FOR TYPE I ERRORS. 
      STA FLBUF     SET POINTER TO BUFFER AGAIN.
* 
      LDA MLINK+1   GET USER ID AND SAVE IT.
      ADA .+?ID-?LINK 
      LDA 0,I 
      STA FLBID 
* 
FLB6  LDB FLBUF,I   GET FIRST WORD OF FILE NAME.
      LDA FLBID 
      SSB           IF BIT 15 OF FIRST WORD IS SET, 
      LDA A000       PERFORM SEARCH USING A000. 
      DST LTEMP 
      ISZ FLBUF     GET NEXT 2 WORDS ALSO.
      DLD FLBUF,I 
      DST LTEMP+2 
* qq
      JSB DLOOK     SEARCH FOR FILE.
      JMP FLB7      FOUND IT. 
* qq
FLB8  JSB RDPRG     IF FILE 
FLB81 CLA             NOT FOUND,
      STA DIRWD         RETURN TO 
      JSB DCMPL           PROGRAM 
      JMP SCHBL 
* qq
FLB7  LDA LTEMP+4   SET DIRWD 
      ADA .+6 
      LDA A,I         FOR DLOOK 
      STA DIRWD 
      LDB LTEMP+5   TEST TO SEE 
      ADB .+2        IF THIS IS 
      LDA 1,I         REALLY A
      SSA,RSS          FILE.
      JMP FLB8      FAIL IF NOT.
      ADB .-1       TEST FOR PROTECTED. 
      LDA 1,I 
      SSA,RSS 
      JMP FLB9      NOT PROTECTED.
      LDA A000      IF PROTECTED, TEST FOR A000.
      CPA FLBID 
      RSS 
      JMP FLB8      PROTECTED FILE ACCESS--FAIL.
* *q
FLB9  ADB .+5       NOW GET DISC ADDRESS AND LENGTH.
      DLD 1,I       STORE DISC ADDRESS
      STA FLBUF,I    IN BUFFER. 
      ASR 7        CONVERT LENGTH TO             X] 
      CMB,INB        POSITIVE SECTORS.
      LDA FLBID     TEST FOR USER REFERENCE TO
      CPA LTEMP      PUBLIC FILE. 
      RSS 
      ADB BIT15     SET BIT15 OF LENGTH IF IT IS. 
      ISZ FLBUF     STORE IN
      STB FLBUF,I    BUFFER.
      ISZ FLBUF     BUMP BUFFER POINTER TO NEXT ENTRY.
      JSB DATE      GET DATE AND SET IN 
      LDB LTEMP+5    PURGE LOCATION.
      ADB .+5 
      STA 1,I 
* qq
      ISZ FLBC1     TEST FOR ANY MORE FILES.
      JMP FLB6
* 
* WE HAVE FOUND ALL THE FILES. WE NOW HAVE TO UPDATE THE FUSS TABLE.
* FIRST CHECK TO SEE IF THE PROGRAM HAS ROOM ENOUGH FOR THE TABLE.
* 
      LDA DIRWD     WRITE 
      LDB LIBD        DIRECTORY 
      JSB DISCL         TO DISC 
      CLA 
      STA DIRWD 
      ISZ SCHLQ     BUMP TO NEXT ERROR EXIT.
      LDA FLBC2     GET # OF FILES. 
      STA FLBC1 
      CMA,INA 
      MPY .+7       COMPUTE NEW VALUE OF PBPTR. 
      ADA PBPTR 
      CMA 
      ADA LWAUS     TEST FOR OVERFLOW.
      SSA 
      JMP FLB8      FAIL--PROGRAM TOO LARGE.
* 
      ISZ SCHLQ     BUMP TO NORMAL RETURN ADDRESS.
      LDA FL128        INPUT FUSS TABLE 
      STA WORD
      LDA FUSS,I
      LDB LIBDI 
      JSB DISCL 
* *q
      LDA MLINK+1   DETERMINE USER #. 
      ADA FLBSP 
      CLB 
      DIV .+TTY01-TTY00 
      ALF,RAR       MULTIPLY USER# BY 8 AND 
      ADA LIBD       ADD LIBD TO POINT AT USER'S
      STA FLBFS       SECTION OF FUSS.
      STA LTEMP 
      LDB .-8       ZERO OUT USER'S SECTION.
      CLA 
      STA LTEMP,I 
      ISZ LTEMP 
      INB,SZB 
      JMP *-3 
* *q
* NOW CHECK TO SEE IF ANY OF THE REQUESTED FILES ARE BEING USED BY
* ANOTHER USER. IF THEY ARE, WE ALLOW ONLY FILE READS BUT NO WRITES.
* IF THE USER IS A000, WE SKIP THE TEST.
* 
      ISZ FLBFP 
      LDA FLBID 
      AND AMASK      IF USER IS A GROUP DON7T TEST
      CPA A000
      JMP FLB10 
* 
      LDA FLBFP     SET BUFFER POINTER. 
      STA FLBUF 
* 
FLB11 LDA FLBUF,I   GET DISC ADDRESS. 
      ISZ FLBUF 
      LDB LIBD      SET INITIAL POINTER TO FUSS.
FLB14 CPA 1,I       TEST FOR THERE. 
      JMP FLB12     IT IS.
      ADB .+2      BUMP POINTER                  X] 
      CPB L128        AND TEST FOR DONE 
      JMP FLB13     NOT THERE.
      JMP FLB14 
* 
FLB12 LDA FLBUF,I   SET DISC LENGTH TO SAY
      IOR BIT15      READ ONLY. 
      STA FLBUF,I 
* 
FLB13 ISZ FLBUF     BUMP BUFFER POINTER FOR 
      ISZ FLBUF      NEXT FILE. 
      ISZ FLBC1     TEST FOR ANY MORE 
      JMP FLB11 
* 
* NOW UPDATE FUSS BY PLACING THE DISC ADDRESSES JUST REQUESTED
* INTO THE USER'S FUSS AREA.
* 
FLB10 LDA FLBC2    SET COUNTER
      STA FLBC1 
      LDA FLBFP    GET POINTER TO FIRST ONE 
      STA FLBUF                                  X] 
FLB15 DLD FLBUF,I  SET DISC ADDRESS              X] 
      DST FLBFS,I  AND LENGTH INTO               X] 
      ISZ FLBUF    THE FUSS AREA                 X] 
      ISZ FLBUF    THE FUSS AREA                 X] 
      ISZ FLBUF 
      ISZ FLBFS                                  X] 
      ISZ FLBFS                                  X] 
      ISZ FLBC1    ANY MORE?
      JMP FLB15    YES
* 
      LDA FUSS,I    WRITE FUSS TABLE BACK TO
      LDB LIBD       DISC.
      JSB DISCL 
* qq
      JSB RDPRG     READ IN USER'S PROGRAM AGAIN. 
      LDA FILTB 
      STA VALTB 
FLB16 DLD FLBFP,I   GET DISC INFO FOR ONE FILE. 
      STB VALTB,I   STORE PHYSICAL LENGTH.
      ISZ VALTB 
      SWP           GET PHYSICAL LENGTH IN A. 
      ELA,CLE,ERA   REMOVE BIT 15.
      ADA .-2       COMPUTE RELATIVE LAST 
      SLA,INA,SZA    LOGICAL SECTOR ADDRESS.
      ADA .-1 
      ADA 1         COMPUTE ABSOLUTE ADDRESS
      STA VALTB,I   STORE IN TABLE. 
      ISZ VALTB 
      ISZ VALTB 
      STB VALTB,I   STORE DISC ADDRESS
      LDA VALTB     BUMP POINTERS.
      ADA .+4 


      STA VALTB 
      STA PBPTR 
      LDA FLBFP 
      ADA .+3 
      STA FLBFP 
      ISZ FLBC2     TEST FOR ANY MORE.
      JMP FLB16 
      CLA           NO DIRECTORY
      STA DIRWD       IN CORE 
* 
      JMP SCHBL     NOW WE'RE ALL DONE. 
* 
* FLBCH GETS THE NEXT CHARACTER OUT OF THE FILES
* STATEMENT. IF FLBCM=1, IT ASSUMES A COMMA HAS BEEN
* SEEN AND RETURNS A BLANK. OTHERWISE IF THE CHARAC-
* TER IS A COMMA, IT SETS FLBCM AND RETURNS A BLANK.
* IT ALSO RETURNS BLANKS AT THE END OF THE CODE.
* 
FLBCH NOP 
      LDA .+40B     RETURN BLANK IF 
      LDB FLBCM     FLBCM IS SET. 
      SZB 
      JMP FLBCH,I 
      LDB FLBCP     GET CHAR. POINTER.
      INB           OTHERWISE BUMP
      CPB FLBP       IF END OF STATEMENT, 
      JMP FLBCH,I   RETURN A BLANK. 
      STB FLBCP      POINTER. 
      CLE,ERB       GET NEXT CHAR.
      LDA 1,I 
      SEZ,RSS 
      ALF,ALF       ROTATE IF NECESSARY.
      AND B177      MASK. 
      SZA,RSS       SKIP 0'S. 
      JMP FLBCH+1 
      ADA M96      MAKE INTO
      SSA,RSS          UPPER
      ADA M32               CASE
      ADA .140
      CPA .+54B     TEST FOR COMMA. 
      RSS 
      JMP FLBCH,I   NOT A COMMA.
      ISZ FLBCM     IF COMMA, SET FLAG AND GO 
      JMP FLBCH+1    RETURN A BLANK.
* 
FLB$  EQU LTEMP 
FLBCM EQU LTEMP+1 
FLBUF EQU LTEMP+6 
FLBFP EQU LTEMP+7 
FLBC1 EQU LTEMP+8 
FLBC2 EQU LTEMP+9 
FLBP  EQU LTEMP+10
FLBCP EQU LTEMP+11
FLBID EQU LTEMP+12
FLBFS EQU LTEMP+13
FLBSP ABS -TTY00-?LINK
FL128 DEC -128
AMASK OCT 76000 
FILBP DEF FILBF 
$FLB  EQU * 
