
      HED REPORT - USER CONSOLE 
* THE REPORT COMMAND IS AVAILABLE TO USER A000 AND CAUSES IDT INFO
* TO BE LISTED ON THE USER CONSOLE. EACH USER ID IS LISTED, ALONG 
* WITH THE DISC AND TIME USED TO DATE. DISC STORAGE IS LISTED IN
* WORDS, AND TIME IS LISTED IN MINUTES. 
* 
      ORG LIBRA 
      LDB MLINK+1 
      ADB .+?ID-?LINK 
      LDA B,I       GET ID
      CPA A000      A000? 
      JMP UREP1     YES 
      LDA .-19      NO, NOT ALLOWED 
      LDB *+2 
      JMP LIBER 
      DEF *+1 
      OCT 5120
      ASC 9,RIVILEGED COMMAND 
UREP1 EQU * 
      CLA,INA       DEFAULT ID
      STA ID          OF 1-1
      JSB LCHAR     GET FIRST CR
      JMP UREP2     CR
      LDB MLINK+1 
      ADB .+?TNUM-?LINK 
      LDA B,I       BACKSPACE 
      IOR BKS         IN BUFFER 
      JSB S14SC,I 
      JSB GETID     GET THE STARTING ID 
      JMP ILFER 
UREP2 EQU * 
      LDA ID        SAVE STARTING 
      LDB MLINK+1     ID
      ADB .+?RTIM-?LINK 
      STA B,I 
* 
* PRINT HEADING 
* 
      JSB UHDBA,I   OUTPUT HEADING
      JSB SCHOU,I     AND SUSPEND 
* 
      LDA URE30     30 WORDS
      STA LTEMP+8     IN HEADING
      LDA URHDA     => FIRST ONE
      STA LTEMP+9 
UREP3 EQU * 
      LDA LTEMP+9,I OUTPUT
      ALF,ALF 
      AND B377
      JSB LOUT        REPORT
      LDA LTEMP+9,I 
      AND B377
      JSB LOUT          HEADING 
      ISZ LTEMP+9 
      ISZ LTEMP+8 
      JMP UREP3           AND SUSPEND 
      JSB SCHOU,I 
* 
* PRINT ONE LINE OF THE REPORT
* 
URE22 EQU * 
      LDB MLINK+1 
      ADB .+?RTIM-?LINK 
      LDA B,I       RETRIEVE
      STA ID          STARTING ID 
      JSB FIDTP,I   FIND WHAT TRACK IT IS ON
      LDA .-3       3 ID'S
      STA LTEMP+5     PER LINE
      LDA IDTLN     => LENGTH WORD
UREP4 EQU * 
      STA LTEMP     SAVE LIVE TABLE ENTRY 
      LDB A,I       GET TRACK LENGTH
      SZB           SKIP IF ZERO
      JMP UREP5 
URE21 EQU * 
      CPA URDCL     LAST ID TRACK?
      JMP URE15 
      ADA .+4         NO - TRY
      JMP UREP4 
UREP5 EQU * 
      STB MWORD     SAVE LENGTH 
      CMB,INB 
      ADB LIBD      MAKE POINTER TO LAST ENTRY+1
      STB LTEMP+2 
      LDA LTEMP     GET DISC ADDRESS
      ADA .-2         POINTER AND 
      LDB LIBDI         READ IN 
      JSB DISCZ,I         IDT TRACK 
      JSB SICKP,I   ERROR - CAN'T GET IT
      LDA LIBD
UREP6 EQU * 
      CPA LTEMP+2   CHECK FOR END 
      JMP URE25     REACHED END OF TRACK
      LDB A,I       GET ID
      CMB 
      ADB ID
      SSB           HAVE WE REACHED OR PASSED THE ID
      JMP UREP9       YES 
      ADA .+8         NO - TRY
      JMP UREP6         NEXT ONE
URE25 EQU * 
      LDA LTEMP     TRY ANOTHER 
      JMP URE21       TRACK 
* 
* READ NEXT TRACK 
* 
URE11 EQU * 
      STB MWORD     SAVE LENGTH 
      CMB,INB 
      ADB LIBD      MAKE POINTER TO LAST WORD +1
      STB LTEMP+2 
      LDA .-2 
      ADA LTEMP     => DISC ADDRESS 
      LDB LIBDI     CORE ADDRESS
      JSB DISCZ,I 
      JSB SICKP,I 
      LDA LIBD
* 
* ADD AN ID TO THE BUFFER FOR OUTPUT
* 
UREP9 EQU * 
      STA LTEMP+4   => ID ENTRY 
      LDA LTEMP+4,I GET ID
      LDB MLINK+1 
      ADB .+?RTIM-?LINK 
      STA B,I       SAVE ID IN TTY TABLE
      ARS,ARS       SHIFT 
      ALF,ALF         LETTER
      AND .+37B         TO 4.0
      ADA B100      ASCII OFFSET
      JSB LOUT      OUTPUT IT 
      LDA LTEMP+4,I GET ID AGAIN
      AND B1777     MASK NUMBER PART
      CLB 
      DIV .100      1ST DIGIT IN A, LAST 2 IN B 
      STB LTEMP+8 
      ADA .+60B 
      JSB LOUT      OUTPUT 1ST
      LDA LTEMP+8 
      JSB URENM     OUTPUT LAST 2 
      LDA LTEMP+4   => TIME 
      ADA .+5         USED
      STA LTEMP+4       AREA
      LDA .+40B     BLANK 
      JSB LOUT
      LDA LTEMP+4,I GET TIME
      JSB URETR     OUTPUT IT 
      ISZ LTEMP+4   => DISC 
      ISZ LTEMP+4     USED
      LDA .+40B     BLANK 
      JSB LOUT
      LDA LTEMP+4,I GET DISC
      JSB URETR     OUTPUT IT 
      LDA .+40B     FOUR
      JSB LOUT
      LDA .+40B 
      JSB LOUT        BLANKS
      LDA .+40B 
      JSB LOUT
      LDA .+40B 
      JSB LOUT
      LDA LTEMP+4 
      INA           BUMP TO NEXT ID 
      CPA LTEMP+2   FINISHED TRACK? 
      RSS           YES 
      JMP URE12     NO, GO CHECK FOR ROOM 
* 
* A TRACK HAS BEEN EXHAUSTED.  CHECK FOR NEED TO CONTINUE 
* 
URE10 EQU * 
      LDA LTEMP     LAST
      CPA URDCL       ID TRACK? 
      JMP URE14     YES, DONE 
      ADA .+4       NO, ADVANCE TO
      STA LTEMP       NEXT IDEC ENTRY 
      LDB A,I       GET LENGTH OF THIS TRACK
      SZB,RSS       IF ZERO, CHECK
      JMP URE10       NEXT ONE
      ISZ LTEMP+5   ANY ROOM LEFT ON LINE 
      JMP URE11     YES 
* 
* PRINT A LINE AND SUSPEND
* 
URE13 EQU * 
      LDA .+23B     XOFF
      JSB LOUT
      LDA .+15B     CR
      JSB LOUT
      LDA .+12B     LF
      JSB LOUT
      LDB MLINK+1 
      ADB .+?RTIM-?LINK 
      ISZ B,I       BUMP ID 
      JSB SCHOU,I   SUSPEND 
      JMP URE22 
* 
* TEST FOR SPACE FOR ANOTHER ENTRY IN THE BUFFER
* 
URE12 EQU * 
      ISZ LTEMP+5   END OF LINE?
      JMP UREP9       NO, DO ANOTHER ENTRY
      JMP URE13       YES, GO SUSPEND 
* 
* TERMINATE 
* 
URE14 EQU * 
      LDA .+23B     X-OFF 
      JSB LOUT
      LDA .+15B     CR
      JSB LOUT
URE15 EQU * 
      LDA .+12B     LF
      JSB LOUT
      JMP LLEND     LF AND END
* 
* URENM CONVERTS * #<100 TO ASCII AND OUTPUTS IT
* 
URENM NOP 
      CLB 
      DIV .+10
      STB LTEMP+11
      ADA .+60B 
      JSB LOUT
      LDA LTEMP+11
      ADA .+60B 
      JSB LOUT
      JMP URENM,I 
* 
* URETR OUTPUTS A 5-DIGIT NUMBER
* 
URETR NOP 
      CLB 
      DIV DVSRS 
      STB LTEMP+12
      ADA .+60B 
      JSB LOUT      1ST DIGIT 
      LDA LTEMP+12
      CLB 
      DIV .100
      STB LTEMP+12
      JSB URENM     DIGITS 2-3
      LDA LTEMP+12
      JSB URENM     DIGITS 4-5
      JMP URETR,I 
URHDA DEF URPHD 
URPHD OCT 5040
      ASC 20,ID  TIME  SPACE     ID  TIME  SPACE
      ASC 7,ID  TIME  SPAC
      OCT 042423    E-XOFF
      OCT 6412      LR-LF 
URE30 DEC -30 
URDCL DEF IDEC+11   => LAST IDT TRACK ENTRY 
$REP$ EQU * 
      HED STATUS - USER CONSOLE 
* THE STATUS COMMAND, AVAILABLE TO USER A000, PRINTS A SUMMARY OF 
* SYSTEM RESOURCES, AND THE EXTENT OF THEIR UTILIZATION, ON THE 
* USER CONSOLE. 
* 
      ORG LIBRA 
      LDB MLINK+1 
      ADB .+?ID-?LINK 
      LDA B,I       GET ID
      CPA A000      A000? 
      JMP USTA0     YES 
      LDA .-19      NO, NOT ALLOWED 
      LDB *+2 
      JMP LIBER 
      DEF *+1 
      OCT 5120
      ASC 9,RIVILEGED COMMAND 
USTA0 EQU * 
      JSB UHDBA,I   PRINT HEADING 
      JSB SCHOU,I     AND SUSPEND 
* 
*  PRINT THE SELECT CODE, IF ANY, OF THE MAG TAPE UNIT. 
* 
      JSB USTST     LF,MAG= 
      OCT 5115
      ASC 2,AG= 
      OCT 0 
      LDA MAGSC     MAGTAPE 
      JSB USTOC       SELECT CODE 
* 
* PRINT THE SELECT CODE, IF ANY, OF THE LPR.  AN APPENDED **
*   INDICATES A 2767 LINE PRINTER IS USED; * INDICATES A 2610 OR
*   2614 LINE PRINTER IS USED.
* 
      JSB USTST 
      ASC 9,   LINE PRINTER = 
      OCT 0 
      LDA LPS       GET THE LINE
      JSB S14SC,I     PRINTER STATUS
      SFS CH2           FROM THE I/O
      JMP *-1             PROCESSOR 
      LIA CH2       A = STATUS
      STA LTEMP 
      AND B77       A = SELECT CODE 
      JSB USTOC     OUTPUT THE SC 
      LDA .+52B     A = '*' 
      LDB LTEMP     B = LP STATUS 
      SSB           CHECK FOR 2610A LP
      JSB LOUT      YES  - OUTPUT '*' 
      LDA .+52B     A = '*' 
      LDB LTEMP 
      RBL 
      SSB           CHECK FOR 2767A LP
      JSB LOUT      YES - OUTPUT '*'
* 
* USER = THE PORT NUMBER OF THE USER CONNECTED TO THE LINE PRINTER. 
* 
      JSB USTST 
      ASC 5,   USER = 
      OCT 0 
      LDB PRIST     GET USER INDICATOR
      SZB,RSS         CHECK FOR USE 
      JMP USTA2     NO
      LDA B,I       YES 
      ALF,ALF         OUTPUT
      JSB UST2D         USER TTY# 
USTA2 JSB XCRLF 
      JSB SCHOU,I   SUSPEND 
* 
* FOR EACH DISC IN THE SYSTEM, THE FOLLOWING INFORMATION IS GIVEN:
*   1) LOGICAL UNIT NUMBER
*   2) SELECT CODE
*   3) PHYSICAL UNIT NUMBER 
*   4) FIRST BLOCK AVAILABLE
*   5) LAST BLOCK AVAILABLE 
* 
      JSB USTST 
      OCT 5104      LF-D
      ASC 2,ISCS
      OCT 11415     XOFF-CR 
      OCT 5040      LF-BLANK
      ASC 19, LOGICAL  SELECT   UNIT   FIRST   LAST 
      OCT 11415     X-OFF-CR
      OCT 5040      LF-BLANK
      ASC 20,  UNIT     CODE   NUMBER  BLOCK   BLOCK
      OCT 0 
      JSB XCRLF     XOFF-CR-LF
      JSB SCHOU,I   SUSPEND 
      CLA           FOR LOGICAL 
      STA LTEMP       DISC 0
USTA4 EQU * 
      LDA LTEMP     FINISHED
      CPA .+8         ALL DISCS?
      JMP USTA5     YES 
      MPY .+6       NO
      ADA MHAD
      ADA .+2 
      LDB A,I 
      LDB B,I       GET SELECT CODE 
      SZB,RSS 
      JMP USTA5-2   SKIP IF ZERO
      STA LTEMP+1 
      JSB USTST     4 BLANKS
      ASC 2,
      OCT 0 
      LDA .+40B     BLANK 
      JSB LOUT
      LDA LTEMP     LOGICAL DISC NUMBER 
      JSB USTDG 
      JSB USTST     6 BLANKS
      ASC 3,
      OCT 0 
      LDA .+40B     BLANK 
      JSB LOUT
      LDA LTEMP+1,I 
      LDA A,I 
      ALF,ALF 
      AND B77 
      JSB USTOC     SELECT CODE 
      JSB USTST     6 BLANKS
      ASC 3,
      OCT 0 
      LDA LTEMP+1,I 
      LDA A,I 
      AND .+3 
      JSB USTDG     UNIT NUMBER 
      JSB USTST     4 BLANKS
      ASC 2,
      OCT 0 
      LDA .+40B     BLANK 
      JSB LOUT
      LDA LTEMP+1   GET SECTOR
      ADA .-2 
      LDB A,I         ADDRESS OF
      INA 
      LDA A,I           THIS DISC 
      CLE,ERB       CONVERT 
      ERA,CLE         TO BLOCKS 
      ADA .+4       FIRST AVAILABLE 
      SEZ             BLOCK IS #4 
      INB 
      JSB UST6D     FIRST BLOCK 
      JSB USTST     2 BLANKS
      ASC 1,
      OCT 0 
      LDA LTEMP+1   GET SECTOR
      ADA .+4 
      LDB A,I         ADDRESS OF
      INA 
      LDA A,I           NEXT DISC 
      CLE,ERB       CONVERT 
      ERA,CLE         TO BLOCKS 
      ADA .-1       LAST BLOCK
      SEZ,RSS         IS 1 LESS 
      ADB .-1 
      JSB UST6D     LAST BLOCK
      JSB XCRLF     XOFF-CR-LF
      JSB USTSV     SAVE VARIABLES
      JSB SCHOU,I   SUSPEND 
      JSB USTRV     RETRIEVE VARIABLES
      ISZ LTEMP 
      JMP USTA4 
* 
* BLOCKS AND/OR RANGES OF BLOCKS WHICH HAVE BEEN LOCKED 
* 
USTA5 EQU * 
      JSB USTST 
      OCT 5114
      ASC 9,OCKED DISC BLOCKS 
      OCT 0 
      JSB XCRLF     XOFF-CR-LF
      JSB SCHOU,I   SUSPEND 
      CLA 
      STA LTEMP+4 
      LDA MHAD      => FIRST DISC 
UST17 EQU * 
      STA LTEMP 
      LDA LIBD      INITIALIZE
      STA LTEMP+1     BUFFER POINTER
      LDA LTEMP 
      ADA .+2 
      LDB A,I 
      LDB B,I       GET SELECT CODE 
      SZB,RSS 
      JMP UST22     DISC NOT PRESENT
UST18 EQU * 
      DLD LTEMP,I   COMPUTE 
      CLE,ERA 
      ERB,CLE         ADDRESS 
      ADB .+3 
      SEZ               OF BAD
      INA 
      DST LTEMP+14        BLOCKS
      LDA M256
      STA MWORD 
      LDA UDL14 
      LDB LIBDI 
      JSB DISCZ,I   READ BAD BLOCKS 
      JMP USTER 
      CLA           PUT ZERO AT 
      STA USTQV,I     BUFFER END
UST19 EQU * 
      LDA LTEMP+1,I GET LOCKED BLOCK ADDRESS
      SZA,RSS 
      JMP UST22     IF ZERO, FINISHED TABLE 
      DLD LTEMP,I   COMPUTE 
      CLE,ERA 
      ERB,CLE         LOGICAL 
      ADB LTEMP+1,I 
      SEZ               BLOCK 
      INA 
      SWP                 ADDRESS 
      DST LTEMP+14
      JSB UST6D     FIRST BLOCK 
      ISZ LTEMP+1 
      CCA 
      ADA LTEMP+1,I 
      SZA,RSS       IF ONLY ONE BLOCK, DON'T
      JMP UST20       PRINT SECOND ADDRESS
      STA LTEMP+5 
      LDA .+55B     '-' 
      JSB LOUT
      DLD LTEMP+14  COMPUTE 
      CLE             LAST
      ADA LTEMP+5       BLOCK 
      SEZ                 ADDRESS 
      INB 
      JSB UST6D     OUTPUT IT 
      CLA,INA       UPDATE
UST20 EQU * 
      INA             COUNT  OF 
      ADA LTEMP+4 
      STA LTEMP+4       ENTRIES ON LINE 
      ISZ LTEMP+1 
      ADA .-8 
      SSA,RSS 
      JMP UST21     PRINT FULL LINE 
      JSB USTST     2 BLANKS
      ASC 1,
      OCT 0 
      JMP UST19 
UST21 EQU * 
      JSB XCRLF     XOFF-CR-LF
      JSB USTSV     SAVE VARIABLES
      JSB SCHOU,I   SUSPEND 
      JSB USTRV     RESTORE VARIABLES 
      CLA           RDSET ENTRY 
      STA LTEMP+4     COUNTER 
      JMP UST18 
UST22 EQU * 
      LDA LTEMP 
      ADA .+6       NEXT DISC 
      LDB MHAD
      ADB .+48
      CPA B         FINISHED ALL 8
      RSS           YES 
      JMP UST17     NO
* 
* PREPARE FOR OVERLAY 
* 
      LDA LTEMP+4 
      SZA 
      JSB XCRLF     NON-BLANK LINE
      CLF 0 
      LDB MLINK+1 
      ADB .+?STAT-?LINK 
      ISZ B,I       SET STATUS TO OVERLAY 
      LDA #LIB#     RESTART ADDRESS 
      INA           SO #OUTC WILL WORK
      JMP USTSO,I 
USTSO DEF SCHSQ 
USTQV DEF LIBUS+256 
      SKP 
      ORG LIBRA+512-120 
* 
* USTLN OUTPUTS A 4-DIGIT DISC AREA LENGTH IN WORDS 
* 
USTLN NOP 
      LDA .+45      OUTPUT
      JSB LOUT        A '-' 
      LDA USTAP,I   OUTPUT THE
      CMA,INA 
      CLB             LENGTH
      DIV .100
      STB LTEMP+7 
      JSB UST2D           IN
      LDA LTEMP+7 
      JSB UST2D             WORDS 
      LDA .+40B     OUTPUT
      JSB LOUT        TWO 
      LDA .+40B 
      JSB LOUT          BLANKS
      JMP USTLN,I 
USTER LDA .-18
      LDB *+2 
      JMP LIBER 
      DEF *+1 
      OCT 6412
      ASC 8,CAN'T READ TABLE
* 
* USTST OUTPUTS A STRING
* 
USTST NOP 
      LDA USTST,I 
      SZA,RSS       ZERO IS 
      JMP USTST,I     END 
      ALF,ALF 
      AND B377
      JSB LOUT      RIGHT CHAR
      LDA USTST,I 
      AND B377
      JSB LOUT
      ISZ USTST 
      JMP USTST+1 
* 
* UST2D OUTPUTS A 2-DIGIT NUMBER
* 
UST2D NOP 
      CLB 
      DIV .+10
      JSB USTDG 
      JSB USTDG 
      JMP UST2D,I 
* 
* USTOC OUTPUTS A 2-DIGIT OCTAL INTEGER 
* 
USTOC NOP 
      CLB 
      DIV .+8 
      JSB USTDG 
      JSB USTDG 
      JMP USTOC,I 
* 
* USTDG OUTPUTS A DIGIT 
* 
USTDG NOP 
      STB LTEMP+8 
      ADA .+60B 
      JSB LOUT
      LDA LTEMP+8 
      JMP USTDG,I 
* 
* UST6D OUTPUTS A 6-DIGIT NUMBER
* 
UST6D NOP 
      DIV DVSRS 
      STB LTEMP+7 
      JSB UST2D     DIGITS 1-2
      LDA LTEMP+7 
      CLB 
      DIV .100
      STB LTEMP+7 
      JSB UST2D 
      LDA LTEMP+7 
      JSB UST2D     DIGITS 5-6
      JMP UST6D,I 
* 
* UST3D OUTPUTS A 3-DIGIT NUMBER
* 
UST3D NOP 
      CLB 
      DIV .100
      JSB USTDG     DIGIT 1 
      JSB UST2D     DIGITS 2-3
      LDA .+40B     BLANK 
      JSB LOUT
      JMP UST3D,I 
* 
* XCRLF OUTPUTS X-OFF, CARRIAGE RETURN AND LINEFEED 
* 
XCRLF NOP 
      LDA .+23B     XOFF
      JSB LOUT
      LDA .+15B     CR
      JSB LOUT
      LDA .+12B     CF
      JSB LOUT
      JMP XCRLF,I 
* 
* USTSV SAVES STATUS VARIABLES
* 
USTSV NOP 
      LDB MLINK+1 
      ADB .+?TEMP-?LINK 
      STB MOVED 
      LDB DLTEM 
      STB MOVES 
      LDB .-3 
      JSB MOVEW 
      JMP USTSV,I 
* 
* USTRV RESTORES STATUS VARIABLES 
* 
USTRV NOP 
      LDB MLINK+1 
      ADB .+?TEMP-?LINK 
      STB MOVES 
      LDB DLTEM 
      STB MOVED 
      LDB .-3 
      JSB MOVEW 
      JMP USTRV,I 
UDL14 DEF LTEMP+14
$STA$ EQU * 
