.TITLE CATVER - CATCHALL Version .IDENT /2.1/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided or ; otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: CATVER.MAC ; Author: Robin Miller ; Date: September 30, 1982 ; ; Description: ; ; This routine simply displays the current version of Catchall. ; It also optionally displays a summary of the catchall commands. ; ; ; Modification History: ; ; October 8, 1984 by Robin Miller. Edit (01), Version 2.1 ; Always display at least three characters in reverse video for ; RSX-11M+. The MCR dispatcher requires three character input ; otherwise you get an "Illegal Function" message. The RSX-11M ; system Version 4.0 or later allows single character input. ; ;- .NLIST BEX ;+ ; ; CATVER - Output a Catchall version and summary of commands. ; ; The summary of commands is taken from the ASCII command names in the ; command table. If the privilege bit is set (B.PRIV in O.STAT), the ; entry is not output so non-privileged users won't see these commands. ; ;- CATIDS: .ASCII "Catchall - Version 2.1 - Monday October 8, 1984" .ASCII "Summary of commands:" CATIDL = .-CATIDS ATTR: .ASCIZ "[7m" ; VT100 Reverse Video NATTR: .ASCIZ "[0m" ; Turn off attributes .EVEN CATVER::MOV #CATIDS,R0 ; Address of header message MOV #CATIDL,R1 ; And the message byte count CALL WRITE ; Output the header message ; Output a summary of the commands available. CALL SKIP ; Skip leading spaces MOV #SPNBUF,R1 ; Use the spawn buffer MOV #CMDTBL,R5 ; Address of the command table MOV #8.,R2 ; Number of commands per line ; Process this table entry. 10$: BIT #S.PRIV,STATUS ; Is the terminal privileged ? BNE 15$ ; If NE, yes (output everything) BIT #B.PRIV,O.STAT(R5) ; Is this a privileged command ? BNE 100$ ; If NE, yes (next entry) 15$: MOV (R5),R0 ; Copy the keyword address ; Check for starting command to display. TSTB STATUS ; Starting command specified ? BPL 17$ ; If PL, no MOV SCMD,R3 ; Start of the command line CMPB (R0),(R3) ; Does this character match ? BNE 100$ ; If NE, no (next entry) 17$: BIT #S.VFAM,STATUS ; VT100 family terminal ? BEQ 40$ ; If EQ, no ; Special output for the VT100 terminal. MOV R0,R4 ; Copy the keyword address MOV #ATTR,R0 ; Turn on the VT100 attributes CALL MOVEC ; Copy to the spawn buffer MOVB O.MIN(R5),R3 ; Minimum number of bytes to type CMP R3,#3 ; Less than three characters ? (01) BGE 20$ ; If GE, no (leave count alone).(01) CMPB O.MIN(R5),O.MAX(R5) ; Minimum and maximum the same ?(01) BEQ 20$ ; If EQ, yes. (01) MOV #3,R3 ; Yes, set minimum count for M+.(01) ; Put number of characters to type for a command in Reverse video. 20$: MOVB (R4)+,(R1)+ ; Copy the minimum number SOB R3,20$ ; Loop until done MOV #NATTR,R0 ; Now turn the attributes off CALL MOVEC ; Append them to the spawn buffer MOV R4,R0 ; Copy the updated keyword address ; Copy the keyword to the output buffer. 40$: CALL MOVEC ; Copy it to the spawn buffer MOVB O.MAX(R5),R3 ; Copy the command length ; Each command is padded to 10 characters with spaces. 50$: MOVB #SPACE,(R1)+ ; Append a space INC R3 ; Count it CMP R3,#10. ; Are we finished ? BLT 50$ ; If LT, no DEC R2 ; Finished with this line ? BNE 100$ ; If NE, no CALL WRTLIN ; Yep, write this line ; Setup for the next table entry. 100$: ADD #TBLSIZ,R5 ; Point to the next entry TST (R5) ; End of the table ? BNE 10$ ; If NE, no CALL WRTLIN ; Write the last line JMP EXISUC ; Exit with success ;+ ; ; WRTLIN - Write the summary line. ; ; Inputs: ; R1 = the updated output buffer address. ; ; Outputs: ; R1 = beginning of the output buffer. ; R2 = the number of entrys per line (8.). ; ; Register R0 is destroyed. ; ;- WRTLIN::MOV #SPNBUF,R0 ; Beginning of output buffer ; Discard trailing spaces. 10$: CMPB #SPACE,-(R1) ; Is this a space character ? BEQ 10$ ; If EQ, yes (skip it) INC R1 ; Point to last character SUB R0,R1 ; Calculate the byte count CALL WRITE ; Output the line MOV R0,R1 ; Reset the buffer address MOV #8.,R2 ; Reset the command count RETURN .END