;--- Keystroke was entered by user - get it and respond to it
GET.COMMAND::
TSTB JOB.ARROW(MEM)
BEQ 4$
CURSOR JOB.ARROW(MEM),ARROW.COL(MEM)
TYPE < >
CLRB JOB.ARROW(MEM)
4$: TIN ; get the character (into D1)
UCS
LEA A0,COMMAND.TABLE
MOV #-2,D0
10$: TSTB @A0
JEQ HEADER.SCAN
ADD #2,D0
CMMB (A0)+,D1
BNE 10$
MOVW JUMP.TABLE[~D0],D0
JMP JUMP.TABLE[~D0]
DEFINE CASE ADDR
WORD ADDR-JUMP.TABLE
ENDM
JUMP.TABLE:
CASE FINISH ; ^C - exit
CASE END ; ^E - end of job list
CASE WIDTH.80 ; ^H - narrow screen
CASE TAB ; TAB - advance to next screen
CASE JOB.DOWN ; ^J - move job down
CASE JOB.UP ; ^K - move job up
CASE WIDTH.132 ; ^L - wide screen
CASE PAGE.BACK ; ^R - page back
CASE PAGE.FORWARD ; ^T - page forward
CASE FINISH ; ESC - exit
CASE HOME ; ^^ - home
CASE HOLD ; SPC - hold
CASE STATS.ON ; + - statistics on
CASE STATS.OFF ; - - statistics off
CASE HELP ; ? - help
CASE SET.DELAY ; 0 - set delay time
CASE SET.DELAY ; 1 - set delay time
CASE SET.DELAY ; 2 - set delay time
CASE SET.DELAY ; 3 - set delay time
CASE SET.DELAY ; 4 - set delay time
CASE SET.DELAY ; 5 - set delay time
CASE SET.DELAY ; 6 - set delay time
CASE SET.DELAY ; 7 - set delay time
CASE SET.DELAY ; 8 - set delay time
CASE SET.DELAY ; 9 - set delay time
CASE ATTACH ; A - attach (operator mode) [105]
CASE COLOR ; C - set background color
CASE DEV.MODE ; D - device mode -or- detach (opr) [105]
CASE ERSATZ.ON.OFF ; E - ersatz on/off
CASE FORCE ; F - force (operator mode) [105]
CASE HELP ; H - help
CASE JOB.MODE ; J - job mode
CASE KILL ; K - kill (operator mode) [105]
CASE LOG.ALERT ; L - log alert on/off
CASE WIDTH.80 ; N - narrow width
CASE OPERATOR ; O - operator mode on/off
CASE PROG.ALERT ; P - prog alert on/off
CASE FINISH ; Q - finish
CASE REFRESH ; R - refresh display
CASE TERM.MODE ; T - terminal mode
CASE USER.ON.OFF ; U - user name display on/off
CASE WIDTH.132 ; W - wide mode
CASE HEIGHT ; X - change height [120]
CASE HELP ; HLP - help key [105]
LOG.ALERT:
BIT #F$OPR,FLAGS(MEM) ; are we in operator mode?
JNE ERROR ; yes - ignore
CURSOR #1,#46.
HIGH
FRED
XOR #F$LOG,FLAGS(MEM)
BIT #F$LOG,FLAGS(MEM)
BEQ LOG.OFF
LOG.ON:
TYPE <LOG-ALERT>
FCYAN
JMP HEADER.SCAN
LOG.OFF:
TYPE < >
FCYAN
JMP HEADER.SCAN
;--- operator mode on/off - only works if user is in [1,2]
OPERATOR:
CMPW MODE(MEM),#M$JOB ; in job display mode? [105]
JNE ERROR ; no [105]
JOBIDX ; A6 <- JCB [105]
CMPW JOBUSR(A6),#1_8.+2 ; in [1,2]? [105]
JNE ERROR ; no - ignore command [105]
CALL OPR.UNMARK ; [105]
AND #^C<F$STATUS>,FLAGS(MEM); turn off status line flag [105]
XOR #F$OPR,FLAGS(MEM) ; [105]
BIT #F$OPR,FLAGS(MEM) ; [105]
BEQ OPR.OFF ; [105]
OPR.ON: CURSOR #1,#46. ; [105]
HIGH ; [105]
FRED
TYPE <SYSTEM OPERATOR MODE > ; [105]
CLRB OPR.MARKER(MEM) ; [105]
CALL OPR.MARK ; [105]
CALL LINE24 ; update help line [105]
FCYAN
JMP HEADER.SCAN ; [105]
OPR.OFF: ; [105]
CURSOR #1,#46.
HIGH
FWHITE
TYPE < > ; [105]
CLRB OPR.MARKER(MEM) ; [105]
CALL LINE24 ; update help line [105]
BIT #F$PROG,FLAGS(MEM) ; [105]
BEQ 10$ ; [105]
CURSOR #1,#57. ; [105]
HIGH ; [105]
TYPE <PROG-ALERT> ; [105]
10$: BIT #F$LOG,FLAGS(MEM) ; [105]
BEQ 20$ ; [105]
CURSOR #1,#46. ; [105]
HIGH ; [105]
TYPE <LOG-ALERT> ; [105]
20$: FCYAN
JMP HEADER.SCAN ; [105]
;--- program alert on/off
PROG.ALERT:
BIT #F$OPR,FLAGS(MEM) ; are we in operator mode?
JNE ERROR ; yes - ignore
CURSOR #1,#57.
HIGH
FRED
XOR #F$PROG,FLAGS(MEM)
BIT #F$PROG,FLAGS(MEM)
BEQ PROG.OFF
PROG.ON:
TYPE <PROG-ALERT>
FCYAN
JMP HEADER.SCAN
PROG.OFF:
TYPE < >
FCYAN
JMP HEADER.SCAN
;--- Attach (operator mode only)
ATTACH: BIT #F$OPR,FLAGS(MEM) ; operator mode? [105]
JEQ ERROR ; no [105]
CMPW MODE(MEM),#M$JOB ; job display? [105]
JNE ERROR ; no [105]
SAVE A0-A5,D0-D5
MOVB JOB.ROW(MEM),D0
INCB D0
CURSOR D0,#1
CLREOS
INCW D0
CURSOR D0,#2
HIGH
TYPESP Attach
CALL OPRJOB
JNE ATTSLF
TYPESP Enter name of terminal to attach:
CALL GET.FIELD ; get name of terminal
JNE ATTRTN ; aborted
ADD #2,D0
CURSOR D0,#1
LEA A1,TEMP+6(MEM) ; convert
LEA A2,TEMP(MEM) ; name
PACK ; to RAD50
PACK ; TRMDEF name is now in TEMP+6(MEM)
ATTSRC: MOV TRMDFC,A0 ; point to start of term table
10$: CMM TEMP+6(MEM),4(A0) ; name match?
BEQ ATTFND ; yes
TST @A0 ; end of table?
JEQ ATTERR ; yes
MOV @A0,A0 ; point to next entry
BR 10$ ; and continue scanning
ATTFND: ADD #10,A0 ; point to the actual TCB
ATTDET: MOV JOBTRM(A3),D7 ; get previous TCB
BEQ 10$ ; none
MOV D7,A4
CLR JOBTRM(A3) ; clear job link to terminal
CLR T.JLK(A4) ; clear terminal link to job
TYPE < Job >
OUTNM2 JOBNAM(A3)
TYPE < detached from Terminal >
OUTNAM -4(A4)
CRLF
10$:
ATTDT2: MOV T.JLK(A0),D7 ; get previous JOB
BEQ 10$ ; none
MOV D7,A4
CLR T.JLK(A0)
CLR JOBTRM(A4)
TYPE < Terminal >
OUTNM2 -4(A0)
TYPE < detached from Job >
OUTNAM JOBNAM(A4)
CRLF
10$:
ATTATT: MOV A0,JOBTRM(A3) ; set job link to terminal
MOV A3,T.JLK(A0) ; set terminal link to job
TYPE < Job >
OUTNM2 JOBNAM(A3)
TYPE < attached to Terminal >
OUTNAM -4(A0)
CRLF
JMP ATTRTN
ATTSLF: TTYI
BYTE 7,0
EVEN
TYPE <?You cannot attach your own job>
BR ATTRTN
ATTERR: ADD #2,D0
CURSOR D0,#2
TTYI
BYTE 7,0
EVEN
TYPE <?Specified terminal not found>
ATTRTN: REST A0-A5,D0-D5
JMP ANYKEY
;--- point A3 to selected JCB, echo job name, move cursor 2 lines down
; set Z normally, clear Z if pointing to own job
FLAG.DEV:
LEA A6,DT.TBL(MEM)
MOV #MAX-1,D6
10$: OR #DT$NEW,DT.FLG(A6)
ADD #DT.SIZ,A6
DBF D6,10$
BIT #F$HEADER,FLAGS(MEM) ; [120]
JNE HEADER ; [120]
JMP TITLE
;--- Detach (operator mode only)
DETACH: SAVE A0-A5,D0-D5
MOVB JOB.ROW(MEM),D0
INCB D0
CURSOR D0,#1
CLREOS
INCW D0
CURSOR D0,#2
HIGH
TYPESP Detach
CALL OPRJOB
JNE DETSLF
MOV JOBTRM(A3),D7
JEQ DETERR
MOV D7,A4
DETDET: CLR JOBTRM(A3) ; clear job link to terminal
CLR T.JLK(A4) ; clear terminal link to job
TYPE <Job >
OUTNM2 JOBNAM(A3)
TYPE < detached from Terminal >
OUTNAM -4(A4)
CRLF
JMP DETRTN
DETSLF: TTYI
BYTE 7,0
TYPE <?You cannot detach your own job>
BR DETRTN
DETERR: ADD #2,D0
CURSOR D0,#2
TTYI
BYTE 7,0
EVEN
TYPE <?Job is already detached>
DETRTN: REST A0-A5,D0-D5
JMP ANYKEY
;--- Toggle ersatz display
ERSATZ.ON.OFF:
CMPW MODE(MEM),#M$JOB
JNE HEADER.SCAN
XOR #F$ERSATZ,FLAGS(MEM)
DECB JOB.ROW(MEM)
JMP TITLE
;--- Force input to another job (operator mode only)
FORCE: BIT #F$OPR,FLAGS(MEM) ; in operator mode? [105]
JEQ ERROR ; no [105]
CMPW MODE(MEM),#M$JOB ; job display? [105]
JNE ERROR ; no [105]
SAVE A0-A5,D0-D5
MOVB JOB.ROW(MEM),D0
INCB D0
CURSOR D0,#1
CLREOS
INCW D0
CURSOR D0,#2
HIGH
TYPESP Force
CALL OPRJOB
JNE FRCSLF
MOV JOBTRM(A3),D7
JEQ DETERR
MOV D7,A5
TYPE <Enter keystrokes to force - press backslash (\) when done:>
ADDW #1,D0
FRCLIN: ADDW #1,D0
CURSOR D0,#2
FRCGET: KBD
CMPB D1,#'\
JEQ FRCEND
CALL IMAGE
TRMICP
CMPB D1,#13.
BEQ FRCLIN
BR FRCGET
FRCEND: ADDW #2,D0
CURSOR D0,#2
TYPE End of force
REST A0-A5,D0-D5
JMP HEADER
FRCSLF: TTYI
BYTE 7,0
TYPE <?You cannot force your own job>
JMP FRCRTN
FRCERR: TTYI
BYTE 7,0
TYPE <?Job >
OUTNM2 JOBNAM(A3)
TYPE < is not attached to a terminal and cannot be forced>
FRCRTN: REST A0-A5,D0-D5
JMP ANYKEY
;--- output printable image of char in D1
IMAGE: SAVE D1
CMPB D1,#40
BLO IMGCTL
CMPB D1,#'~
BHI IMGNUM
TTY
BR IMGRTN
IMGCTL: TYPE ^
ADDB #'@,D1
TTY
BR IMGRTN
IMGNUM: TYPE {
DCVT 0,OT$TRM
TYPE }
IMGRTN: REST D1
RTN
;--- Kill another job (operator mode only)
KILL: BIT #F$OPR,FLAGS(MEM) ; in operator mode? [105]
JEQ ERROR ; no [105]
CMPW MODE(MEM),#M$JOB ; job display? [105]
JNE ERROR ; no [105]
SAVE A0-A5,D0-D5
MOVB JOB.ROW(MEM),D0
INCB D0
CURSOR D0,#1
CLREOS
INCW D0
CURSOR D0,#2
HIGH
TYPESP Kill
CALL OPRJOB
JNE KILSLF
ORW #J.CCC,JOBSTS(A3)
TYPESP Job
OUTNM2 JOBNAM(A3)
TYPE < killed>
JMP KILRTN
KILSLF: TTYI
BYTE 7,0
TYPE <?You cannot kill your own job>
KILRTN: REST A0-A5,D0-D5
JMP ANYKEY
;--- Toggle user name field
USER.ON.OFF:
CMPW MODE(MEM),#M$JOB
JNE HEADER.SCAN
XOR #F$USER,FLAGS(MEM)
DECB JOB.ROW(MEM)
JMP TITLE
;--- Statistics On
STATS.ON:
BIT #F$HEADER,FLAGS(MEM)
JNE HEADER.SCAN
OR #F$HEADER,FLAGS(MEM)
JMP HEADER
;--- Statistics Off
STATS.OFF:
BIT #F$HEADER,FLAGS(MEM)
JEQ HEADER.SCAN
AND #^C<F$HEADER>,FLAGS(MEM)
JMP HEADER
;--- Page Back
PAGE.BACK:
MOV #22.,D0
MOVBL JOB.ROW(MEM),D1
SU
B D1,D0
CMMW JOB.OFFSET(MEM),D0
JLO HOME
SUBW D0,JOB.OFFSET(MEM)
CURSOR JOB.ROW(MEM),#1
CLREOS
DECB JOB.ROW(MEM)
JMP TITLE
HELP.TEXT:
ASCIZ "USTAT command summary page 1 of 3"
ASCIZ ""
ASCIZ "DISPLAY MODES"
ASCIZ ""
ASCIZ " The J, T, and D keys change the display mode:"
ASCIZ ""
ASCIZ " J - show job status"
ASCIZ " T - show terminal status"
ASCIZ " D - show device status"
ASCIZ ""
ASCIZ "HEADER CONTROL"
ASCIZ ""
ASCIZ " The header statistics area may be turned off with the minus key (-),"
ASCIZ " and back on again with the plus key (+)."
ASCIZ ""
ASCIZ "DISPLAY CONTROL"
ASCIZ ""
ASCIZ " The R key redisplays the screen"
ASCIZ " The SPACE BAR key suspends the screen; press SPACE again to resume"
ASCIZ ""
ASCIZ "Press any key to continue or ESC to quit: "
ASCIZ "USTAT command summary page 2 of 3"
ASCIZ ""
ASCIZ "ADJUSTING THE DISPLAY"
ASCIZ ""
ASCIZ " The job, terminal, or status display is a virtual window that is"
ASCIZ " larger than the size of the terminal screen. The keys described"
ASCIZ " below allow you to move around in this window."
ASCIZ ""
ASCIZ " The UP ARROW key scrolls the display up one line"
ASCIZ " The DOWN ARROW key scrolls the display down one line"
ASCIZ ""
ASCIZ " The PREV SCREEN key (Control-R) backs up one full screen"
ASCIZ " The NEXT SCREEN key (Control-T) moves forward one screen"
ASCIZ ""
ASCIZ " The HOME key (Control-^) moves to the beginning of the display window"
ASCIZ " The s/HOME key (Control-E) moves to the end of the display window"
ASCIZ ""
ASCIZ " Press W for a wide screen 132-column display, N for 80-columns"
ASCIZ " Press X to switch between 24 & 42 line mode (if terminal supports it)"
ASCIZ ""
ASCIZ "Press any to continue or ESC to quit: "
ASCIZ "USTAT command summary page 3 of 3"
ASCIZ ""
ASCIZ "JOB DISPLAY OPTIONS"
ASCIZ ""
ASCIZ " The E key toggles the ersatz log feature. When this feature is"
ASCIZ " enabled (the default), ersatz names are shown for the log"
ASCIZ " account of each job. When the ersatz log feature is turned"
ASCIZ " off, the actual device code and drive number is shown."
ASCIZ ""
ASCIZ " The U key toggles the user name feature. When this feature is"
ASCIZ " enabled (the default), each user's name is shown as part of the"
ASCIZ " job display line. When the user name feature is turned"
ASCIZ " off, disk reads, disk writes, and priority is shown instead."
ASCIZ ""
ASCIZ ""
ASCIZ ""
ASCIZ ""
ASCIZ ""
ASCIZ ""
ASCIZ ""
ASCIZ "Press any key to resume status display: "