      HED KILLID
* THE KILLID ROUTINE IS USED TO REMOVE ID CODES FROM THE SYSTEM 
* IDTABLE. THE FORMAT IS: 
* 
*     KILLID - IDCODE 
* *q
* IDCODE A000 CANNOT BE KILLED BY THIS COMMAND. 
* 
* KILLID PERFORMS THE FOLLOWING FUNCTIONS:
* 
* 1. THE ID-CODE IS REMOVED FROM THE IDT. 
* 2. ANY USERS LOGGED ON WITH THIS NUMBER ARE DUMPED. 
* 3. ALL LIBRARY SPACE ALLOCATED TO THIS ID IS RETURNED TO THE
*    SYSTEM.
      SPC 2 
      ORG LIBRA 
      JSB GETID     TRANSLATE THE IDCODE. 
      JMP LFRER     ERROR IF NO CR FOLLOWD. 
      LDA ID        TEST FOR A000.
      CPA A000
      JMP KID31 
* 
* READ IN IDT.
* 
      JSB FIDT     FIND ID ENTRY
      RSS          GOT IT 
      JMP KID32     NO SUCH ID
* 
* REMOVE ID FROM TABLE. 
* 
      STB MOVED 
      ADB .+8 [[[[
      STB MOVES 
      ADB MLIBD 
      ADB IDTLA,I 
      JSB MOVEW 
KID.1 LDA IDTRA      IS THIS THE
      CPA IDTTA        LAST TRACK?
      JMP KID33      YES
* 
      LDA IDTLA,I     WAS THE TRACK FULL? 
      ADA .-8 
      CPA M3072 
      RSS            YES
      JMP KID33       NO - WRITE IT OUT 
      LDA IDTLA    GO TO NEXT TRACK 
      ADA .-1         TO FILL IN THIS ONE 
      STA KDTP1     SAVE POINTER TO NEXT TRACK LENG 
      LDB 0,I      LOAD TRACK LENGTH
      SZB,RSS       EMPTY?
      JMP KID33 3_
      LDA IDTRA    SET ADDRESS POINTER TO 
      ADA .-1         NEXT TRACK
      STA KDTP2          AND SAVE IT
      LDB IDTLA,I  COMPUTE
      ADB .+8          LAST CORE ADDRESS
      CMB,INB            OF PREVIOUS
      ADB LIBDI              TRACK
      LDA .-8     READ IN 
      STA WORD       ONE MORE ENTRY 
      LDA KDTP2,I I+
      JSB DISCL 
      LDA IDTLA,I OUTPUT
      STA WORD      FULL
      LDA IDTRA,I     TRACK 
      LDB LIBD           TO 
      JSB DISCL             DISC
* *q
      LDA KDTP1    UPDATE 
      STA IDTLA       POINTERS
      LDA KDTP2         TO
      STA IDTRA             NEXT TRACK
      LDA IDTLA,I    READ IN
      STA WORD
      LDA IDTRA,I       THE NEXT TRACK
      LDB LIBDI             OF THE
      JSB DISCL                IDT
      LDA LIBD
      STA MOVED 
      ADA .+8      SQUEEZE OUT
      STA MOVES       FIRST ENTRY 
      LDB IDTLA,I        (WHICH IS NOW ON PREVIOUS TRACK) 
      ADB .+8 
      JSB MOVEW 
      JMP KID.1 
* 
KID33 LDA IDTLA,I    OUPUT
      ADA .+8         ID
      STA IDTLA,I       TRACK 
      STA WORD
      LDA IDTRA,I 
      LDB LIBD
      JSB DISCL 
      LDA IDLEN     UPDATE TOTAL ID LENGTH
      ADA .+8 
      STA IDLEN 
* 
* SEARCH TTY TABLES FOR ANY USER TO BE DUMPED.
* 
      LDA .-16      SET COUNTER 
      STA KIDC
      CCA           SET KIDT TO SAY NONE
      STA KIDT       FOUND YET. 
      LDB DTTY0 
      ADB .+?ID 
KID34 LDA 1,I       GET ID FROM TABLE.
      CPA ID        IS IT THIS USER?
      JMP KID35     YES--GO DUMP HIM. 
KID37 ADB .+TTY01-TTY00 
      ISZ KIDC      ANY MORE TO TEST? 
      JMP KID34     YES.
      JMP KID36     NO--TRANSFER TO NEXT PART.
* 
* DUMP THE USER.
* 
KID35 STB KIDB      SAVE POINTER TO TABLE.
      CLF 0         INHIBIT INTERRUPT.
      ADB .+?STAT-?ID 
      LDA %DISC     SET USER'S                   [E]
      STA B,I         STATUS TO %DISC 
      ADB .+?MASK-?STAT 
      LDA MPCOM 
      IOR B,I       SET PORT COMMUNICATIONS 
      STA MPCOM       FLAG TO INFORM SCHEDULER
      ADB .-?MASK+?LINK 
      JSB KIDEQ,I   REMOVE FROM QUEUE.
      STF 0 
      ISZ KIDT      IS FUSS TABLE IN CORE?
      JMP KID38     YES.
      LDA M128      NO -- READ IT IN
      STA WORD
      LDA FUSS,I
      LDB LIBDI 
      JSB DISCL 
* 
KID38 LDA KIDC      COMPUTE LOCATION OF USER'S FUSS 
      ADA .+16
      ALF,RAR                                    X] 
      ADA LIBD
      STA KIDP
      LDB .-8      ZERO OUT USER'S FUSS AREA     X] 
      CLA **
      STA KIDP,I
      ISZ KIDP
      INB,SZB 
      JMP *-3 
* 
      LDB KIDB      GET POINTER AGAIN.
      JMP KID37     GO TEST NEXT USER.
* 
KID36 LDA FUSS,I    WRITE BACK FUSS 
      LDB LIBD       IF ANY USERS 
      ISZ KIDT        WERE DUMPED.
      JSB DISCL 
* 
* WE HAVE NOW GOTTEN RID OF THE USER. THE NEXT STEP IS TO CALL
* THE KILLID OVERLAY TO RELEASE ANY SYSTEM SPACE CONSUMED BY THE
* USER. 
* 
      LDA M252      SET WORD COUNT
      STA WORD
      DLD LIB,I     GET DISC ADDRESS
      LDA 1          OF OVERLAY.
      LDB #LIBI 
      JMP LIBRA+254 
KIDEQ DEF DEQUE 
* qq
KID31 LDA KIDM1     PRINT "A000 NOT ALLOWED"
      LDB .-17
      JMP *+3 
KID32 LDA KIDM2     PRINT "NO SUCH ID"
      LDB .-11||
      STB KIDC
      STA MOVES 
      LDA T35B1 
      STA MOVED 
      BRS 888[
      JSB MOVEW 
      LDA KIDC
      CMA,INA 
      LDB T35B1 
      JSB TTY35,I 
      JMP LENDR 
* 
KIDM1 DEF *+1 
      OCT 5101
      ASC 8,000 NOT ALLOWED 
KIDM2 DEF *+1 
      OCT 5116
      ASC 5,O SUCH ID 
* qq
      ORG LIBRA+254 PERFORM OVERLAY.
      JSB DISCL 
      JMP LIBRA 
$KID  EQU * *
      HED KILLID OVERLAY SECTION
* THE KILLID OVERLAY IS CALLED BY KILLID AFTER IT HAS TAKEN CARE OF 
* THE EASY PART OF KILLID. THIS SECTION HAS THE JOB OF REMOVING ALL 
* FILES BELONGING TO THE ID BEING KILLED FROM THE USER LIBRARY, AND 
* UPDATING THE ADT APPROPRIATELY. 
      ORG LIBRA 
      LDA DIRD3     TEST INDIVIDUAL DIRECTORIES 
KID4  STA KIDI      KIDI POINTS TO THE ONE TESTED.
      DLD KIDI,I    GET LENGTH AND FIRST ID.
      STB KIDT      SAVE FIRST ID FOR LATER.
      CLE                                        B] 
      ADB MID       B=FIRST ID- KEYID 
      SZA           FORGETTRACK IF IT'S EMPTY 
      SEZ,SZB         OR IF FIRSTID>KEYID        B] 
      RSS 
      JMP KID2
KID1  LDA KIDI
      CPA DIRD0 
      JMP KID18 
      ADA .-7       BUMP TO NEXT TRACK. 
      JMP KID4
* *q
* PROCESS DIRECTORY TRACK IN ORDER TO REMOVE KEY ID ENTRIES. THE
* DIRECTORY IS READ INTO THE BEGINNING OF THE WORKSPACE AND IS
* SCANNED IN REVERSE ORDER. A TABLE OF PATCHES IS BUILT UP FROM THE 
* OTHER END. THE FOLLOWING POINTERS ARE USED: 
* 
* KIDP1 => DIRECTORY ENTRY BEING TESTED 
* KIDP2 => FIRST ENTRY FOLLOWING LAST KID ENTRY 
* KIDP3 => LAST ENTRY IN DIRECTORY
* KIDP4 => LAST ENTRY IN PATCH TABLE
* KIDK  = -# OF WORDS AVAILABLE FOR PATCH TABLE.
* 
KID2  STA WORD      SET UP LENGTH FOR DISC TRANSFER.
      ADA USEND     GET # WORDS 
      CMA,INA         LEFT
      ADA LIBD          IN
      STA KIDK            KIDK
      LDA WORD      SET END 
      CMA,INA         OF DIRECTORY
      ADA .-8           POINTER 
      ADA LIBD
      STA KIDP3      ENTRY IN DIRECTORY.
      STA KIDP1     SET POINTER TO CURRENT ENTRY. 
      LDA USEND     INITIALIZE PATCH TABLE
      STA KIDP4      POINTER. 
      LDA KIDI      GET DIRECTORY 
      ADA .+6        DISC ADDRESS 
      LDA 0,I         IN A, 
      LDB LIBDI       ADDRESS OF WORKSPACE
      JSB DISCL       IN B, & READ DISC.
* *q
KID7  LDA KIDP1,I   GET ID OF NEXT ENTRY
      ELA,CLE,ERA 
      ADA MID       COMPARE WITH KEY ID.
      SSA           TEST FOR <
      JMP KID6
      SZA           TEST FOR >
      JMP KID8
* qq
* FOUND AN ENTRY FOR KID. NOW REMOVE IT.
* qq
      LDB KIDP1     IF THIS IS THE FIRST
      ADB .+8        SUCH ENTRY, SET KIDP2 AS 
      LDA KIDP4       STATED ABOVE. 
      CPA USEND 
      STB KIDP2 
      LDA KIDI,I    ADJUST THE DIRECTORY LENGTH.
      ADA .+8 
      STA KIDI,I
* qq
      ADB .-2       SAVE DISC LOC & LENGTH OF AREA
      DLD 1,I        IN LTEMP.
      DST LTEMP 
      LDB KIDK      TEST FOR ANY ROOM IN
      SZB            PATCH AREA.
      JMP KID9
* 
* MAKE ROOM BY PUSHING UP PARTIALLY EXAMINED DIRECTORY. 
* 
      LDB KIDP1     SET UP
      STB MOVED      DEST AND 
      LDB KIDP2       SOURCE. 
      STB MOVES 
      CMB           COMPUTE # 
      ADB KIDP3      OF WORDS 
      CMB             TO MOVE 
      ADB .-8          AND
      JSB MOVEW        DO IT. 
* 
      LDB KIDP2     SET B=-# OF WORDS 
      CMB,INB        GAINED.
      ADB KIDP1 
      LDA KIDP1     ADJUST KIDP2,KIDP3, AND KIDK. 
      STA KIDP2 __
      LDA KIDP3 
      ADA 1 1
      STA KIDP3 
* 
KID9  ADB .+2       TAKE 2 WORDS FROM 
      STB KIDK       PATCH TABLE. 
      LDB KIDP4     MOVE PATCH POINTER
      ADB .-2       BACK2 WORDS.
      STB KIDP4 
      LDB LTEMP+1   GET NEGATIVE WORD LENGTH. 
      ASR 7        CONVERT TO POSITIVE           X] 
      CMB,INB        SECTORS. 
      LDA LTEMP     GET DISC ADDRESS. 
      DST KIDP4,I   STORE PATCH.
* qq
KID8  LDB KIDP1     TEST FOR FINISHED 
      CPB LIBD       EXAMINING DIRECTORY ENTRIES. 
      JMP KID6
      ADB .-8       IF NOT, MOVE POINTER BACK TO
      STB KIDP1     NEXT ENTRY. 
      JMP KID7
* 
* THE PATCH TABLE IS NOW BUILT. THE NEXT STEP IS TO FIXUP THE DIREC.
* 
KID6  LDA KIDP4     IF THE PATCH TABLE IS EMPTY, WE 
      CPA USEND     DIDN'T DO ANYTHING
      JMP KID1
* *q
      LDA KIDI,I
      SZA,RSS       IF LENGTH=0 WE DONT HAVE TO 
      JMP KID10      WRITE IT BACK OUT. 
      STA WORD      SET UP FOR DISC DRIVER. 
* qq
* WE FIRST HAVE TO CLOSE UP THE HOLE. THER ARE 2
* CASES, DEPENDING UPON WHITHER THE HOLE IS AT THE
* BEGINNING OR IN THE MIDDLE. 
* 
      LDA KIDP2     WE WILL MOVE FROM KIDP2 IN
      STA MOVES      ANY CASE.
      LDB KIDT      GET FIRST ID IN B.
      CPB ID        IF = HOLE IS AT BEGINNING 
      JMP KID11     GO SET NEW FIRST ID.
      LDA KIDP1     SET DEST. TO BE RIGHT AFTER 
      ADA .+8        LAST ENTRY EXAMINED. 
      CPA MOVES     FORGET IT IF SAME AS SOURCE.
      JMP KID12 
      LDB KIDP3     COMPUTE # OF WORDS TO MOVE. 
      CMB,INB 
      ADB KIDP2 
      ADB .-8 
      JMP KID13     GO MOVE IT. 
* 
KID11 LDA KIDI      SET UP NEW FIRST ID.
      INA 
      LDB .-5 
KID13 STA MOVED 
      JSB MOVEW 
* qqq{
* NOW WRITE DIRECTORY BACK TO DISC. 
* 
KID12 LDB LIBD      DETERMINE CORE ADDRESS. 
      LDA ID
      CPA KIDT
      LDB KIDP2 
      LDA KIDI      GET DISC ADDRESS. 
      ADA .+6 
      LDA 0,I 
      JSB DISCL     WRITE DISC. 
* 
KID10 LDA ADLEN     READ IN ADT.
      STA WORD
      LDA ADLOC 
      LDB LIBDI 
      JSB DISCL 
* yq
* GO THROUGH THE PATCH TABLE ONE ELEMENT AT A TIME, 
* POINTING TO IT WITH KIDP4.
* 
      LDB LIBD      SCAN ADT FOR FIRST ENTRY BEYOND 
KID14 LDA KIDP4,I  SAVE THE DISC AND HEAD        X] 
      AND DHMSK    ADDRESS OF THE DISC           X] 
      STA LTEMP+14 ADDRESS                       X] 
KID.5 LDA 1,I      LOAD ADT ENTRY                X] 
      AND DHMSK    GET DISC AND HEAD             X] 
      CPA LTEMP+14 SAME AS REQUIRED?              X]
      JMP KID.4    YES                            X]
      ADB .+2      NO, NEXT ENTRY                 X]
      JMP KID.5                                   X]
KID.4 STB LTEMP+13 SAVE ENTRY POINTER             X]
      LDA 1,I      LOAD ENTRY                     X]
      CMA,CLE,INA  SUBTRACT REQUIRED ONE           X] 
      ADA KIDP4,I                                  X] 
      SZA,RSS       IF = FORGET THE WHOLE PATCH.THIS
      JMP KID17     MIGHT HAPPEN IF ADT+PATCHTABLE
*                                       IS TOO BIG. 
      SEZ,RSS 
      JMP KD.10 
      ADB .+2      NOPE, TRY NEXT ENTRY          X] 
      LDA 1,I      LOAD ENTRY                    X] 
      AND DHMSK    GET DISC AND HEAD             X] 
      CPA LTEMP+14 IF SAME AS BEFORE STILL NOT DONE 
      JMP KID.4+1  SAME    TRY NEXT ENTRY        X] 
      ADB .-2                               (L) 
* qq
* FOUND FIRST ENTRY BEYOND PATCH. 
* *q
KD.10 EQU * 
      STB KIDP1     SAVE ADDRESS OF THAT ENTRY. 
      LDB KIDP4     SET A=LOC(PATCH)+LEN(PATCH) 
      INB                -LOC(NEXT ENTRY)=0 IF
      ADA 1,I              ADJACENT.
      ADA .-1 
      STA KIDK
      LDB KIDP1     NOW DETERMINE IF PREVIOUS 
      ADB .-2        ENTRY IS ADJACENT TO NEW 
      DLD 1,I         ENTRY.
      ADB 0 
      STB KIDJ
      DLD KIDP4,I 
      CPA KIDJ
      JMP KID15     IT IS.
* qq
* THE NEW ENTRY IS NOT ADJACENT TO THE PREVIOUS ENTRY.
* qq
      ISZ KIDK      ADJACENT TO NEXT AREA?
      JMP KID16       NO. 
      STA KIDP1,I   RESET FOLLOWING ENTRY SO ITS AD-
      ISZ KIDP1      DRESS IS THAT OF THE NEW ONE & 
      ADB KIDP1,I     ITS SIZE IS THE SUM.
      STB KIDP1,I 
      JMP KID17 
* 
KID16 DST LTEMP     SAVE NEW ENTRY. 
      LDA ADLEN 
      ADA .-2       GET ADLEN-2 
      STA 1         SAVE IN B.
      ADA P3072    MAKE SURE IT WILL FIT         X] 
      SSA           OK
      JMP KID17     FORGET IT IF NO FIT.
      CMB           SET DEST FOR MOVE TO
      ADB LIBD        LIBUS-ADLEN+1 
      STB MOVED 
      ADB .-2       SET SOURCE TO LIBUS-ADLEN-1 
      STB MOVES 
      CMB           #OF WORDS =-(LIBUS-ADLEN-P1)
      ADB KIDP1 
      JSB MOVEB 
      DLD LTEMP     NOW SET NEW ENTRY 
      DST KIDP1,I    INTO TABLE,
      LDA .-2         BUMP ADLEN. 
      JMP KID21 
* *q
KID15 ISZ KIDK      ADJACENT TO PREVIOUS AREA---
      JMP KID19     ---BUT NOT TO FOLLOWING ONE.
      LDA KIDP1     WE ARE GOING TO COMBINE 3 AREAS.
      STA MOVED 
      INA 
      ADB 0,I       ADD LENGTH OF FOLLOWING AREA. 
      ADA .-2 
      ADB 0,I       ADD LENGTH OF PRECEDING AREA
      STB 0,I       SET AS NEW LENGTH.
      ADA .+3       SET B=SOURCE OF SLIDE.
      STA MOVES 
      LDB ADLEN     COMPUTE 
      ADB MLIBD     LENGTH OF MOVE. 
      ADB 0 
      JSB MOVEW W

      LDA .+2       DECREMENT 
KID21 ADA ADLEN        ADLEN. 
      STA ADLEN 
      JMP KID17 
* qq
KID19 CCA           ADJUST LENGTH OF PREVIOUS AREA
      ADA KIDP1      BY ADDING LENGTH OF NEW AREA.
      ADB 0,I xx
      STB 0,I 
* 
KID17 LDA KIDP4     BUMP KIDP4 TO POINT AT NEW
      ADA .+2        PATCH ENTRY. 
      CPA USEND     TEST FOR DONE 
      JMP *+4 
      STA KIDP4 
      LDB LTEMP+13                               X] 
      JMP KID14    GO FOR NEXT PATCH ENTRY       X
* 
* WRITE ADT TO DISC 
* 
      LDB ADLEN N
      STB WORD
      LDA ADLOC 
      LDB LIBD
      JSB DISCL 
* 
      JMP KID1
KID18 CLF 0 
      CLA 
      STA LIB 
      JMP LEND
$$KID EQU * *o
      ORG LTEMP 
KIDP  BSS 1 
KIDC  BSS 1 
KIDB  BSS 1 
KIDI  BSS 1 
KIDJ  BSS 1 
KIDK  BSS 1 
KIDP1 BSS 1 
KIDP2 BSS 1 1)
KIDP3 BSS 1 
KIDP4 BSS 1 ??
KIDT  BSS 1 
KDTP1 BSS 1 
KDTP2 BSS 2 
      HED *MOVE*
* 
*     THE MOVE ROUTINE IS USED TO MOVE PROGRAMS 
* AND FILES FROM 1 DISC TO ANOTHER. 
*     THE FORM OF THE COMMAND IS: 
* MOVE-<ID>,<NAME>,<SUBCHANNEL> 
*     THE INDICATED PROGRAM OR FILE IS MOVED
* TO THE NEW SUBCHANNEL.
* 
      SPC 2 
      ORG LIBRA 
      SPC 1 
      JSB GETID    GET THE ID 
      RSS 
      JMP LFRER    STATEMENT END
      CPA .+54B    COMMA? 
      RSS          YES
      JMP LFRER    NO-ERROR 
      JSB T35CH,I  GET NEXT CHAR
      JMP LFRER    ERROR-CR 
      CPA .+54B    COMMA? 
      JMP LFRER Rd
* 
*     GET FILE OR PROGRAM NAME
* *q
      ALF,ALF 
      IOR .+40B 
      STA LTEMP+1 
      LDA .-2 
      STA MOVCT 
      LDA DLTEM 
      ADA .+2 
      STA MOVPT 
      JSB T35CH,I  GET CHAR 
      JMP LFRER    NONE LEFT
      CPA .+54B    COMMA? 
      JMP MOV.1    YES
      LDA LTEMP+1   TAKE CARE 
      XOR .+40B       BLANK 
      IOR T35LC     ADD NEW CHARACTER 
      STA LTEMP+1 
      LDA DLTEM 
      ADA .+2 
      STA MOVPT    SAVE POINTER 
MOV.3 JSB T35CH,I 
      JMP LFRER Rd
      CPA .+54B    DO WE WANT IT. 
      JMP MOV.1 
      ALF,ALF   ROTATE CHARACTER TO UPPER HALF
      STA MOVPT,I Io
      JSB T35CH,I 
      JMP LFRER 
      CPA .+54B 
      LDA .+40B 
      IOR MOVPT,I 
      STA MOVPT,I 
      LDA T35LC RELOAD LAST CHARACTER 
      ISZ MOVPT 
      ISZ MOVCT  DONE?
      RSS 
      JMP MOV.2 
      CPA .+54B 
      RSS 
      JMP MOV.3 
MOV.1 LDA MOVBL    FILL IN
      STA MOVPT,I  BLANKS FOR 
      ISZ MOVPT    REMAINDER
      ISZ MOVCT    IF NAME
      JMP *-3 
MOV.2 LDA T35LC   GET LAST CHARACTER AGAIN
      CPA .+54B    COMMA? 
      JMP MV.F     OK 
      JSB  T35CH,I   NO - GET COMMA 
      JMP LFRER        NOT THERE
      CPA .+54B      COMMA??
      JMP MV.F         YES
      JMP LFRER        NO 
MV.F  EQU * 
      JSB T35CH,I  GET SUBCHANEL
      JMP LFRER    NONE 
      STA MOVSB    SAVE CHAR
      JSB T35CH,I  CR?
      RSS 
      JMP LFRER    NO-ERROR 
      LDA MOVSB    LOAD SUBCHANNEL
      ADA M72B     TEST FOR DIGIT 
      SSA,RSS 
      JMP LFRER    NO 
      ADA .+10
      SSA 
      JMP LFRER    NO 
* 
*     SUBCHANNEL IS IN A
*     NOW FORM DISC ADDRESS 
* 
      STA 1 
      ADB .-4      VALID SUBCHANNEL 
      SSB,RSS 
      JMP LFRER    NO 
      CLE,ERA 
      RAR 
      SEZ,RSS 
      IOR B100      FIXED DISC BIT
      STA MOVDS    SAVE IT
* 
*     NOW LOOK FOR PROGRAM NAME 
* qq
* 
      LDA ID
      STA LTEMP 
      JSB DLOOK    SEARCH DIRECTORY 
      RSS 
* 
*     NO SUCH PROGRAM 
      JMP MV.ER    NO SUCH PROGRAM
      LDB LTEMP+5 
      ADB .+6 
      LDA 1,I 
      STA MDADA     SAVE DISC ADDRESS 
      ADB .-4       IS THIS 
      LDA 1,I         A FILE? 
      SSA,RSS       * 
      JMP MOV.4     NO
      LDA M128      YES - 
      STA WORD        CHECK IF
      LDA FUSS,I        BUSY
      LDB LIBDI     LOAD
      JSB DISCL       FUSS
      LDB LIBD
MVR.1 LDA 1,I IY
      CPA MDADA     FILE BUSY?
      JMP MOVFB     YES 
      ADB .+2 
      CPB L128      DONE? 
      JMP MVR.2     YES - IT'S OK 
      JMP MVR.1     NO
* 
MOVFB LDA MBFMS     OUTPUT
      STA MOVES       BUSY
      LDA T35B1         MESSAGE 
      STA MOVED 
      LDB .-5 
      JSB MOVEW 
      LDA .+10
      LDB T35B1 
      JSB TTY35,I 
      JMP LENDR 
* 
MBFMS DEF *+1 
      OCT 5102
      ASC 4,USY FILE
MVR.2 LDB LTEMP+4   RELOAD
      LDA 1,I         DIRECTORY 
      STA WORD          TRACK 
      ADB .+6 
      LDA 1,I 
      LDB LIBDI 
      JSB DISCL 
MDADA EQU LTEMP+121O
MOV.4 LDB LTEMP+5  GO TO ENTRY
      ADB .+6      GET DISC ADDRESS 
      LDA 1,I 
      AND DHMSK    IS IT ON CORRECT 
      CPA MOVDS      DISC?
      JMP LEND     YES-ALL DONE 
* 
      LDA 1,I 
      STA MOVD1    DAVE OLD DISC ADR
      INB 
      LDA 1,I 
      STA MOVWD    SAVE LENGTH
      CCB 
      ASR 7        CONVERT TO SECTORS 
      STA MOVLN 
      LDB LTEMP+5   MOVE
      STB MOVES       CORRECT 
      LDB DLTEM         NAME WITH 
      STB MOVED           FILE AND PROTECT
      LDB .-4               BITS
      JSB MOVEW               TO TEMPORARY BUFFER 
* 
*     SEARCH ADT FOR ENTRY ON THE RIGHT DISC
* 
      LDA ADLEN 
      STA WORD
      ARS 
      STA MOVCT 
      LDA ADLOC 
      LDB LIBDI 
      JSB DISCL    READ ADT 
* 
      LDB LIBD
      STB MOVPT    SAVE POINTER 
MOV.6 LDA 1,I 
      AND DHMSK    RIGHT DISC?
      CPA MOVDS 
      JMP MOV.5 
MOV.A EQU * 
      ADB .+2 
      ISZ MOVCT    NO MORE? 
      JMP MOV.6 
      JMP MOV.C 
MOV.5 INB          GET LENGTH 
      LDA 1,I      POINT BACK AGAIN 
      ADB .-1 
      ADA MOVLN 
      SSA 
      JMP MOV.A 
* 
*     SUFFICIENT SPACE HAS GEEN FOUND 
*     ON THE REQUESTED DISC 
* 
      DLD 1,I      LOAD ENTRY 
      DST MADT     SAVE ADT ENTRY 
* 
      LDB LTEMP+4   LOAD
      LDA 1,I         DIRECTORY TRACK 
      STA WORD
      ADB .+6 
      LDA 1,I 
      LDB LIBDI 
      JSB DISCL 
      LDB LTEMP+5  GET PROG START 
      ADB .+4 
      LDA 1,I 
      STA MPROG    SAVE PROGRAM START 
      INB 
      LDA 1,I      GET PURGE DATE 
      STA MPURG    +SAVE IT 
* 
      LDA MOVDS    SET UP+
      STA LTEMP+6  COMPUTE REQUESTED
MOV.G LDA MVOVL 
      STA WORD
      LDB LIB 
      INB 
      LDA 1,I 
      LDB #LIBI 
      JMP LIBRA+252 
* qq
*     DISC OVERLOAD 
* *q
MOV.C LDA MVER1       MOVE ERROR MESSAGE
      STA MOVES            TO TTY 35 BUFFER 
      LDA T35B1 
      STA MOVED 
      LDB .-8 
      JSB MOVEW 
      LDA .+9 
      LDB T35B1 ##
      JSB TTY35,I      OUTPUT 'SYSTEM OVERLOAD' 
      JMP LENDR 
MV.ER LDA MVSMS   LOAD MESSAGE ADDRESS
      STA MOVES   AND SAVE FOR MOVE BUFFER ROUTINE
      LDA T35B1   SET DESTINATION ADDRESS 
      STA MOVED 
      LDB .-8      MOVE 8 WORDS 
      JSB MOVEW    MOVE ERROR MESSAGE INTO TTY35 BUF
      LDA .+16
      LDB T35B1 
      JSB TTY35,I   OUTPUT MESSAGE
      JMP LENDR 
* 
MVOVL ABS LIBRA-$$MOV 
MVER1 DEF FD.1+11 
MVSMS DEF *+1 
      OCT 5116
      ASC 7,O SUCH PROGRAM
MOVBL ASC 1,
      ORG LIBRA+252 
      JSB DISCL    LOAD OVERLAY 
      JMP LIBRA 
$MOV  EQU * 
