
      HED STATUS OVERLAY - USER CONSOLE 
      ORG LIBRA 
* 
**
*** THE FOLLOWING CODE PRINTS OUT DISC ALLOCATION INFORMATION 
**
* 
      JSB USTST 
      OCT 5104
      ASC 7,ISC ALLOCATION
      OCT 11415     XOFF-CR 
      OCT 5012      LF-LF 
* 
* PRINT OUT IDT INFORMATION - DISC ADDRESS AND LENGTH IN WORDS
* 
      ASC 3,  IDT 
      OCT 0 
      JSB XCRLF     PRINT XOFF-CR-LF
      LDA .-3       3 IDT 
      STA USTAC       TRACKS
      LDB USTID     LOAD POINTER TO 
      STB USTAP       DISC ADDRESS
UST30 EQU * 
      DLD USTAP,I   GET ADDRESS 
      ISZ USTAP     MOVE POINTER
      ISZ USTAP       TO LENGTH 
      SZA,RSS 
      SZB 
      RSS 
      JMP UST31     SKIP IF ZERO
      SWP 
      JSB UST6D     OUTPUT ADDRESS
      JSB USTLN       AND LENGTH
UST31 EQU * 
      ISZ USTAP     MOVE POINTER TO NEXT
      ISZ USTAP       DISC ADDRESS
      ISZ USTAC     FINISHED? 
      JMP UST30     NO
      JSB XCRLF     XOFF-CR-LF
* 
* PRINT OUT ADT INFORMATION - DISC ADDRESS AND LENGTH IN WORDS
* 
      JSB USTST 
      OCT 6412      CR-LF 
      ASC 3,  ADT 
      OCT 0 
      JSB XCRLF     PRINT XOFF-CR-LF
      JSB SCHOU,I   SUSPEND 
      LDA UST41     SAVE POINTER
      STA USTAP       TO ADT INFORMATION
      LDA .-5       5 PER 
      STA USTAC       LINE
UST23 DLD USTAP,I   GET ADDRESS 
      ISZ USTAP     MOVE POINTER
      ISZ USTAP       TO 'LENGTH' 
      SZA,RSS 
      SZB 
      RSS 
      JMP UST24     SKIP IF ZERO
      SWP 
      JSB UST6D     OUTPUT ADDRESS
      JSB USTLN       AND LENGTH
      ISZ USTAC     LINE FILLED?
      JMP UST24       NO
      LDA .-5         YES - RESET 
      STA USTAC         COUNTER 
      JSB XCRLF 
      JSB USTSV     SAVE VARIABLES
      JSB SCHOU,I   PRINT & SUSPEND 
      JSB USTRV     RESTORE VARIABLES 
UST24 ISZ USTAP     MOVE POINTER TO NEXT ADDRESS
      LDA USTAP 
      CPA UST42     FINISHED? 
      RSS             YES 
      JMP UST23       NO
      LDA USTAC 
      CPA .-5 
      RSS           SKIP BLANK LINE 
      JSB XCRLF 
      JSB SCHOU,I 
* 
* PRINT OUT DIRECTORY TRACK INFORMATION - DISC ADDRESSES AND LENGTHS
* IN WORDS
* 
      JSB USTST 
      OCT 5040
      ASC 3, DIREC
      OCT 0 
      JSB XCRLF 
      LDA USTD6     DIREC TABLE 
      STA USTAP        ADDRESS
      LDA .-5       5 PER 
      STA USTAC       LINE
UST25 LDA USTAP 
      ADA .+5       GET DISC
      DLD A,I         ADDRESS 
      SZA,RSS 
      SZB 
      RSS 
      JMP UST26     SKIP IF ZERO
      SWP 
      JSB UST6D     OUTPUT ADDRESS
      JSB USTLN       AND LENGTH
      ISZ USTAC     LINE FILLED?
      JMP UST26       NO
      LDA .-5         YES - RESET 
      STA USTAC         COUNTER 
      JSB XCRLF 
      JSB USTSV     SAVE VARIABLES
      JSB SCHOU,I   SUSPEND 
      JSB USTRV     RESTORE VARIABLES 
UST26 LDA USTAP     MOVE POINTER TO 
      ADA .+7         NEXT TRACK ADDRESS
      STA USTAP 
      CPA USTDU     FINISHED? 
      RSS             YES 
      JMP UST25       NO
      LDA USTAC 
      CPA .-5 
      RSS           SKIP PRINTING OF BLANK LINE 
      JSB XCRLF 
* 
* PRINT OUT SYSTEM INFORMATION
* 
      JSB USTST 
      OCT 5040
      ASC 4, SYSTEM 
      OCT 0 
      JSB XCRLF     PRINT XOFF-CR-LF
      DLD DADSL     GET SYSTEM LIBRARY ADDRESS
      SWP             AND 
      JSB UST6D         OUTPUT IT 
      LDA .+45      OUTPUT
      JSB LOUT        A '-' 
      LDA DLNSL     GET LENGTH
      JSB UST3D       AND OUTPUT IT 
      JSB USTST     OUTPUT
      ASC 1,          TWO 
      OCT 0             BLANKS
      LDB LDBSA     GET POINTER 
      ADB .+3         TO FIRST DISC 
      STB USTAP         ADDRESS IN SST
      LDA .-4 
      JSB USTSS     SEGMENTS 1-4
      JSB XCRLF 
      JSB USTSV     SAVE VARIABLES
      JSB SCHOU,I   SUSPEND 
      JSB USTRV     RESTORE VARIABLES 
      LDA .-5 
      JSB USTSS     SEGMENTS 5-9
      JSB XCRLF 
      JSB USTSV     SAVE VARIABLES
      JSB SCHOU,I   SUSPEND 
      JSB USTRV     RESTORE VARIABLES 
      LDA .-4 
      JSB USTSS     SEGMENTS 10-13
      JSB XCRLF 
      JSB USTST 
      OCT 5040
      ASC 3, USERS
      OCT 0 
      JSB XCRLF 
      JSB SCHOU,I 
      LDA .-8       8 PER 
      STA LTEMP+3     LINE
      LDB USTSW     => DISC ADDRESS FOR TTY00 
UST37 EQU * 
      STB LTEMP 
      DLD LTEMP,I   GET ADDRESS 
      SZA,RSS 
      SZB 
      RSS 
      JMP UST39     DONE IF ZERO
      SWP 
      JSB UST6D     OUTPUT IT 
      LDA .+40B     OUTPUT
      JSB LOUT        TWO 
      LDA .+40B 
      JSB LOUT          BLANKS
      ISZ LTEMP+3   LINE FULL?
      JMP UST38     NO
      JSB XCRLF 
      JSB USTSV     YES 
      JSB SCHOU,I 
      JSB USTRV 
      LDA .-8 
      STA LTEMP+3 
UST38 EQU * 
      LDB LTEMP 
      ADB .+TTY01-TTY00 
      CPB USTUS     FINISHED ALL USERS
      RSS           YES 
      JMP UST37     NO
UST39 EQU * 
      LDA LTEMP+3 
      CPA .-8 
      RSS           SKIP BLANK LINE 
      JSB XCRLF 
      JMP LLEND 
      SKP 
* 
* USTBR READS THE BOOTSTRAP 
* 
USTBR NOP 
      LDA M512
      STA MWORD     LENGTH
      CLA 
      CLB,INB 
      DST LTEMP+14  DISC ADDRESS
      LDB LDBSA     CORE ADDRESS
      ADB BIT15 
      LDA UDL14 
      JSB DISCZ,I   READ IT 
      JMP USTER 
      JMP USTBR,I 
* 
* USTSS FILLS THE BUFFER WITH SYSTEM SEGMENT
* ADDRESSES AND LENGTHS 
* 
USTSS NOP 
      STA LTEMP+3   SAVE # OF SEGMENTS
      JSB USTBR     READ BOOTSTRAP
USTS1 EQU * 
      DLD LTEMP,I   GET DISC ADDRESS
      SWP 
      JSB UST6D     OUTPUT IT 
      LDA .+45      OUTPUT '-'
      JSB LOUT
      LDB LTEMP 
      ADB .-2 
      LDA B,I       GET LENGTH
      ADB .+6 
      STB LTEMP 
      ALF,ALF       CONVERT 
      IOR HIMSK 
      CMA,INA         TO BLOCKS 
      JSB UST3D     OUTPUT IT 
      JSB USTST     2 BLANKS
      ASC 1,
      OCT 0 
      ISZ LTEMP+3 
      JMP USTS1 
      JMP USTSS,I 
USTD6 DEF DIREC 
USTDU DEF DIREU 
UST41 DEF ADTAT 
UST42 DEF DKTBL 
USTAP EQU LTEMP 
USTAC EQU LTEMP+1 
USTID DEF IDEC+1
USTSW DEF TTY00+?DISC 
USTUS DEF TTY32+?DISC 
      HED DELETE
* THE DELETE COMMAND ALLOWS A USER TO DELETE A SECTION OF HIS 
* PROGRAM IN A SINGLE LINE. THE FORMAT IS:
*     DELETE-M,N
*  OR 
*     DELETE-M
* WITH THE FIRST FORMAT, ALL LINES FROM M THROUGH N ARE 
* DELETED. WITH THE SECOND, ALL LINES FROM M TO THE END OF
* THE PROGRAM ARE DELETED.
      SPC 1 
      ORG LIBRA 
      JSB DELNM     GET M.
      STA DELM
      LDA DEL99 
      CPB .+54B     IF COMMA FOLLOWS, GO
      JSB DELNM      GET N. 
      STA DELN
      CPB .+15B     NEXT CHAR MUST BE A CR. 
      JMP DEL2
      JMP ILFER 
* 
DEL2  CMA           CHECK FOR M<=N
      ADA DELM
      SSA,RSS 
      JMP ILFER 
* 
      JSB RDPRG     READ IN PROGRAM AND 
      JSB DCMPL      DECOMPILE IT.
* 
      LDA PBPTR     LOCATE FIRST
      LDB DELM       STATEMENT TO BE DELETED. 
      JSB FNDPS 
      RSS 
      NOP 
      STB MOVED 
* 
      LDA PBPTR     LOCATE FIRST STATEMENT
      LDB DELN       NOT TO BE DELETED. 
      STA MOVES 
      CPB DEL99 
      JMP DEL3
      INB 
      JSB FNDPS 
      RSS 
      NOP 
      STB MOVES 
* 
DEL3  LDB MOVES     IF DEST=SOURCE, NOTHING DELETED.
      CPB MOVED 
      JMP DEL4
      CMB,INB       OTHERWISE, MOVE UP. 
      ADB PBPTR 
      CMB,INB 
      JSB MOVEW 
      LDA MOVED     SET NEW VALUE OF
      STA PBPTR      PBPTR. 
      LDB MLINK+1 
      ADB .+?FLAG-?LINK 
      LDA PUALT 
      CMA           CLEAR PROGRAM 
      AND B,I         UNALTERED BIT 
      STA B,I 
      STB MAIN      TELL SCHEDULAR USER IS IN CORE
      JMP LLEND 
* 
DEL4  LDA MLINK+1 
      ADA .-?LINK 
      STA MAIN
      LDA .-17
      LDB *+2 
      JMP LIBER 
      DEF *+1 
      OCT 5116      LF-N
      ASC 7,OTHING DELETED
      OCT 6400      CR
* 
* DELNM READS A NUMBER FROM THE USER'S BUFFER. IN CASE OF ERROR IT
* GOES TO DEL1. OTHERWISE IT RETURNS WITH A=# AND B=NEXT CHAR.
* 
DELNM NOP 
      CLA           INITIALIZE TO 0.
DEL7  EQU * 
      STA DELT
      JSB LCHAR     GET A CHARACTER 
      NOP 
      STA 1         SAVE IN B.
      ADA M72B      TEST FOR DIGIT. 
      SSA,RSS 
      JMP DEL6
      ADA .+10
      SSA 
      JMP DEL6
      LDB DELT
      ADB DELMX 
      SSB,RSS 
      JMP ILFER 
      LDB DELT      MPY OLD VALUE BY 10.
      RBL,RBL 
      ADB DELT
      RBL 
      ADA 1         ADD IN NEW. 
      JMP DEL7      LOOP. 
* 
DEL6  LDA DELT      GET VALUE 
      SZA           FAIL IF ZERO. 
      JMP DELNM,I 
      JMP ILFER 
* 
DELM  EQU LTEMP 
DELN  EQU LTEMP+1 
DELT  EQU LTEMP+2 
DEL99 DEC 9999
DELMX DEC -1000 
$DEL  EQU * 
      HED TIME
* THE TIME COMMAND PRINTS THE USER'S CONSOLE TIME DURING THIS 
* SESSION AND HIS TOTAL CONSOLE TIME TO DATE. 
      SPC 1 
      ORG LIBRA 
      SPC 1 
      LDA .-16      OUTPUT START OF 
      LDB TIM1       MESSAGE. 
      JSB LTYPR 
* 
      LDA MLINK+1   COMPUTE LOC OF USER'S 
      ADA .+?TIME-?LINK  STARTING TIME. 
      DLD 0,I       GET STARTING TIME.
      CMA,INA       MAKE NEGATIVE AND 
      CMB,INB        SAVE IN TIMT.
      DST TIMT
      DLD DATIM     GET CURRENT TIME. 
      ADA TIMT      COMPUTE DIFFERENCES: A=# OF HRS;
      CLE           B=# OF 100 MS UNITS.
      ADB TIMT+1     E=-SIGN OF B.
      STB TIMT+1    SAVE UNITS. 
      MPY D60       CHANGE HRS TO MINS. 
      STA TIMT
      LDA TIMT+1    GET UNIT COUNT. IF E=0
      SEZ,RSS        THEN COUNT IS NEGATIVE.
      CCB 
      DIV D600      CHANGE TO MINS. 
      ADA TIMT      ADD IN PREVIOUS AMT.
      STA TIMT
      JSB TIMPR     PRINT IT. 
* 
      LDA .-14      OUTPUT SOME MORE
      LDB TIM2       CHARACTERS.
      JSB LTYPR 
* 
      JSB GCID,I    READ IN THE IDT 
* 
      ADB .+5       GET TIME TO DATE. 
      LDA 1,I 
      ADA TIMT      ADD IN CURRENT TIME.
      JSB TIMPR     PRINT IT. 
* 
      LDA .+15B     OUTPUT CR.
      JSB LOUT
      JMP LLEND     TERMINATE.
* 
TIM1  DEF *+1 
      OCT 5103      LF-C
      ASC 7,ONSOLE TIME = 
TIM2  DEF *+1 
      ASC 7, TOTAL TIME = 
TIM3  DEF *+1 
      ASC 5, MINUTES. 
* 
* TIMPR OUTPUTS THE INTEGER IN A TO THE CONSOLE.
* 
TIMPR NOP 
      SZA,RSS       SPECIAL CASE OF ZERO. 
      JMP TIMP1 
      STA TIMNM     SAVE ORIGINAL NUMBER. 
      LDB TIMXK     GET INITIAL DIVISOR OF 10000. 
      STB TIMDV 
TIMP4 CLB           COMPUTE A DIGIT.
      DIV TIMDV 
      STB TIMN      SAVE REMAINDER. 
      CPB TIMNM     IF REMAINDER=ORIGINAL NUMBER
      JMP TIMP2     THIS IS A LEADING ZERO. 
      ADA .+60B     OUTPUT
      JSB LOUT       DIGIT. 
TIMP2 LDA TIMDV     PRODUCE NEW DIVISOR.
      CLB 
      DIV .+10
      STA TIMDV 
      SZA,RSS       DONE IF DIVISOR IS ZERO.
      JMP TIMP3 
      LDA TIMN      GET # AGAIN AND LOOP. 
      JMP TIMP4 
TIMP1 LDA .+60B     OUTPUT SINGLE 0.
      JSB LOUT
TIMP3 LDA .-9       PRINT 
      LDB TIM3       "MINUTES." 
      JSB LTYPR 
* 
      JMP TIMPR,I 
* 
TIMXK DEC 10000 
TIMN  EQU LTEMP 
TIMT  EQU LTEMP+1 
TIMNM EQU LTEMP+3 
TIMDV EQU LTEMP+4 
$TIM  EQU * 
