Trailing-Edge
-
PDP-10 Archives
-
BB-L288A-RM
-
swskit-utilities/swserr.mac
There are 4 other files named swserr.mac in the archive. Click here to see a list.
TITLE SWSERR PRODUCE COMPACT LISTING OF BUGXXX ERRORS
SUBTTL J. G. ZIMA/JGZ MAY 1980
SEARCH MACSYM,MONSYM ;GET SYMBOLS
SEARCH SERCOD ;GET SYSERR SYMBOLS
SALL ;NICE LOOKING MACROS
.DIRECT FLBLST ;AND NICE LISTING
;VERSION INFORMATION:
VMAJOR==1 ;MAJOR VERSION LEVEL
VMINOR==0 ;MINOR VERSION LEVEL
VEDIT==16 ;EDIT LEVEL
VWHO==0 ;WHO LAST EDITED
; TABLE OF CONTENTS PAGE
; ----------------- ----
;
; 1. J. G. ZIMA/JGZ MAY 1980. . . . . . . . . . . . . . . . . . 1
; 2. COMMAND SCANNER AND INITIALIZATION . . . . . . . . . . . . . 6
; 3. THE SIMPLE COMMANDS - EXIT, HELP, PUSH, TAKE . . . . . . . . 8
; 4. WHAT COMMAND TO SHOW PARAMETER SETTINGS. . . . . . . . . . . 11
; 5. INCLUDE COMMAND TO VARY LISTING. . . . . . . . . . . . . . . 13
; 6. IGNORE COMMAND TO MODIFY LISTING FORMAT. . . . . . . . . . . 14
; 7. TIME COMMAND TO SET TIME RANGE . . . . . . . . . . . . . . . 15
; 8. READ COMMAND TO SPECIFY ALTERNATE INPUT FILE . . . . . . . . 16
; 9. LIST COMMAND TO DO IT. . . . . . . . . . . . . . . . . . . . 17
; 10. THE MAIN PROCESSING LOOP . . . . . . . . . . . . . . . . . . 18
; 11. ENTRY INPUT AND VALIDATION ROUTINES. . . . . . . . . . . . . 22
; 12. OUTPUT CONVERSION ROUTINES . . . . . . . . . . . . . . . . . 28
; 13. PAGE HEADER PRINTING ROUTINE . . . . . . . . . . . . . . . . 30
; 14. VERSION NUMBER PRINTING. . . . . . . . . . . . . . . . . . . 31
; 15. SUMMARY PRINTING ROUTINE . . . . . . . . . . . . . . . . . . 32
; 16. ERROR PROCESSING AND COMND HELPER ROUTINES . . . . . . . . . 35
; 17. THE DATA AREA. . . . . . . . . . . . . . . . . . . . . . . . 37
;REVISION HISTORY:
;
; 1 JGZ 7-MAY-80
; BEGIN KEEPING REVISION HISTORY FROM NOW ON.
;
; 2 JGZ 7-MAY-80
; ADD "YES" AND "NO" TABLES AND THEIR INITIALIZATION, SO
; THAT THEY CAN BE USED TO "INCLUDE J0NRUN", OR TO DO A
; "INCLUDE NO DN20ST" WITH A FEW MORE EDITS.
; ADD ROUTINES TO SEARCH BOTH THE TABLES FOR A MATCH
; AND CALL THEM FROM THE PROCESSING LOOP. STILL HAVE TO
; CHANGE THE COMMAND PARSING AND FILL THE TABLES.
;
; 3 JGZ 7-MAY-80
; ADD A SINGLE LEVEL JFN STACK TO KEEP UNUSED JFNS FROM
; PILING UP ON REPARSE ERRORS.
;
; 4 JGZ 8-MAY-80
; PUT IN THE CODE TO PARSE SPECIFIC BUGNAMES IN THE
; INCLUDE COMMAND.
;
; 5 JGZ 8-MAY-80
; DISCOVERED A V4 COMND BUG. WON'T PARSE THE STRING
; "INCLUDE NO BUGNAME" UNLESS YOU ESC AFTER THE NO.
; DECIDES TO DO INCLUDE OF "NO BUG". HAS SOMETHING
; TO DO WITH DEFAULT STRING ALSO. SO CHANGED TO HAVE
; NO DEFAULT STRING, AND TO REQUIRE BUGNAME BE QUOTED
; UNTIL COMND FIXED AT LEAST.
;
; 6 JGZ 10-MAY-80
; DECIDED TO ALLOW POSSIBLY WILD BUGNAMES IN INCLUDE
; COMMAND, WHICH MEANS REWRITE OF ALL THE INCLUDE
; STUFF. GO ASCIZ ALL THE WAY WITH THE NON-INCLUDE PARTS.
;
; 7 JGZ 11-MAY-80
; PRETTY UP LISTING, ADD TABLE OF CONTENTS, IMPROVE HELP
; TEXT.
;
; 10 JGZ 14-MAY-80
; PRETTY UP WHAT COMMAND OUTPUT BY PADDING IGNORE OUTPUT
; WITH BLANKS IN "NO" POSITION.
;
; 11 JGZ 16-MAY-80
; ON SECOND THOUGHT, TRAP AND NOTE ALL DIRST ERRORS IN PROCLP.
;
; 12 JGZ 26-JUN-80
; TIME TO SUMMARY LINE, DO IGNORE COMMAND TO GET RID OF
; QUOTED BUG NAMES, CLEANUP HELP TEXT, BEGIN CODE TO READ
; BUGSTRINGS.TXT.
;
; 13 JGZ 26-JUN-80
; COMPLETE CODE FOR READING SYSTEM:BUGSTRINGS.TXT FOR THOSE
; BUG MESSAGES NOT IN SYSERR BLOCK: SLOW BUT EFFECTIVE.
;
; 14 JGZ 26-JUN-80
; "FINAL" LISTING CLEANUP AND NEW TABLE OF CONTENTS.
;
; 15 JGZ 28-JUN-80
; BETTER ERROR HANDLING FOR GETMSG ROUTINE, BKJFN STUFF
; TO PROCLP CODE TOO...
;
; 16 JGZ 16-JAN-81
; MAKE IT TYPE OUT THE VERSION NUMBER ON STARTUP.
;
;ACCUMULATORS:
F=0 ;FLAGS
T1=1 ;TEMPORARY AC'S
T2=2
T3=3
T4=4
P1=10 ;PRESERVED AC'S
P2=11
P3=12
P4=13
P5=14
P6=15
CX=16 ;MACSYM USE, MACROS...
P=17 ;STACK
;DEFAULT PARAMETERS:
TXTLEN==^D100 ;SIZE OF COMMAND BUFFERS
PDLSIZ==30 ;SIZE OF PUSHDOWN STACK
PAGSIZ==^D55 ;NUMBER OF LINES/PAGE
SUMSIZ==^D100 ;NUMBER OF ENTRIES ALLOWED IN SUMMARY TABLE
;CONSTANTS:
HF.ERR==377 ;ENTRY TYPE INDICATION ERROR IN FILE
HF.EOF==777 ;ENTRY TYPE INDICATING END-OF-FILE
HF.T20==1B17 ;ENTRY HEADER BIT FOR TOPS-20
HF.VER==1 ;SYSERR VERSION WE KNOW ABOUT
HDRDAT==1 ;OFFSET TO DATE-TIME WORD
INTCHN==0 ;CHANNEL FOR ^E INTERRUPT
.CHSPC==40 ;**;SPACE CHARACTER UNTIL IN MACSYM
;FLAGS:
FL%TIM==1B0 ;CHECK ENTRIES FOR TIME RANGE
FL%CHK==1B1 ;INCLUDE BUGCHKS
FL%INF==1B2 ;INCLUDE BUGINFS
FL%HLT==1B3 ;INCLUDE BUGHLTS
FL%IFS==1B4 ;INPUT FILE SPECIFIED
FL%FDO==1B7 ;FORCE DATE OUTPUT AT START OF PAGE
FL%OFO==1B8 ;OUTPUT FILE IS OPEN
FL%NOF==1B9 ;"NO" FLAG FOR "NO" SEEN
;MACROS, OPDEFS, AND DEFSTRS:
DEFINE AA(NAME,DATA),< ;;MACRO FOR COMMAND TABLES
XWD [ASCIZ/NAME/],DATA
>
DEFINE SPACE(NUMBER),< ;;MACRO FOR NUMBER OF SPACES
MOVEI P1,NUMBER ;;GET THE NUMBER
CALL SPCOUT ;;DO THE SPACES
>
DEFINE TEXT(STRING),< ;;MACRO FOR ASCIZ TEXT
XLIST
ASCIZ\STRING\
LIST
>
DEFSTR HDRLEN,HDRWRD,26,3 ;HEADER LENGTH FIELD
DEFSTR ENTLEN,HDRWRD,35,9 ;ENTRY LENGTH FIELD
DEFSTR HDRCOD,HDRWRD,8,9 ;ENTRY TYPE CODE
DEFSTR HDRVER,HDRWRD,23,6 ;VERSION LEVEL
DEFSTR BUGPI,BUGPIS,27,7 ;PI LEVEL IN CONI PI, WORD
SUBTTL COMMAND SCANNER AND INITIALIZATION
EVEC: JRST SWSERR ;START
JRST REEN ;REENTER
BYTE (3)VWHO(9)VMAJOR(6)VMINOR(18)VEDIT ;VERSION
SWSERR: RESET ;CLEAR EVERYTHING
MOVE P,[IOWD PDLSIZ,PDL] ;SET UP A STACK
TMSG <SWSERR BUGxxx LISTER %>
MOVEI T1,.PRIOU ;TO THE TERMINAL
CALL VEROUT ;GIVE OUR VERSION NUMBER
TMSG <
> ;AND SPACE DOWN
REEN: MOVE P,[IOWD PDLSIZ,PDL] ;SET UP A STACK
TXZ F,FL%FDO!FL%OFO ;INITIALIZE FLAGS
TXO F,FL%HLT!FL%CHK!FL%INF ;INCLUDE EVERYTHING
SETZM NAMTAB ;CLEAR INCLUDE NAME TABLE
SETZM OLDPRM ;CLEAR PRIMARY I/O SAVE CELL
SETZM TAKJFN ;CLEAR TAKE FILE JFN/STATE
MOVX T1,.FHSLF ;SETUP THE
MOVE T2,[LEVTAB,,CHNTAB] ; INTERRUPT SYSTEM
SIR
MOVX T1,.FHSLF ;AND ACTIVATE
MOVX T2,1B<INTCHN> ;THE CHANNEL TO USE FOR ^E INTERRUPTS
AIC
MOVX T1,.FHSLF ;AND FINALLY
EIR ; TURN IT ON, WITH NOTHING ON THE CHANNEL
NEWCMD: MOVEI T1,CMDBLK ;POINT TO COMMAND BLOCK
MOVEI T2,[FLDDB. .CMINI] ;INITIALIZATION FUNCTION
CALL COMMND ;GO DO IT
MOVEM P,SAVEP ;SAVE STACK FOR REPARSING
NEWPAR: MOVE P,SAVEP ;RESTORE THE STACK
SKIPE T1,JFNTMP ;CLEAN UP ANY STACKED JFNS
RLJFN ; FROM REPARSING
ERJMP .+1 ;IGNORE THIS CASE
SETZM JFNTMP ;AND MARK JFN FREED
MOVEI T1,CMDBLK ;POINT TO THE COMMAND BLOCK
MOVEI T2,[FLDDB. (.CMKEY,,CMDTAB)] ;POINT TO COMMAND TABLE
CALL COMMND ;READ IT
MOVE T2,(T2) ;GET ADDRESS OF ROUTINE
CALL (T2) ;CALL IT
JRST NEWCMD ;AND GET A NEW COMMAND
RSKP: AOS 0(P) ;YE OLDE
R: RET ;SKIP RETURN
;TABLE OF COMMANDS:
CMDTAB: CMDLEN,,CMDLEN ;HEADER
AA EXIT,CMDXIT ;EXIT COMMAND
AA HELP,CMDHLP ;TYPE HELP MESSAGE
AA IGNORE,CMDIGN ;IGNORE STUFF
AA INCLUDE,CMDINC ;INCLUDE STUFF
AA LIST,CMDLST ;SET UP OUTPUT SPEC
AA PUSH,CMDPSH ;PUSH TO A NEW EXEC
AA READ,CMDRED ;SET UP INPUT SPEC
AA TAKE,CMDTAK ;TAKE COMMANDS FROM FILE
AA TIME,CMDTIM ;SET BEGIN AND END TIMES
AA WHAT,CMDWHT ;WHAT ARE SWITCH SETTINGS
CMDLEN==.-CMDTAB-1 ;NUMBER OF COMMANDS
SUBTTL THE SIMPLE COMMANDS - EXIT, HELP, PUSH, TAKE
;EXIT FROM PROGRAM. "EXIT" COMMAND.
CMDXIT: MOVEI T2,[ASCIZ/FROM PROGRAM/] ;GET NOISE
CALL NOISE ;EAT NOISE WORDS
CALL CONFRM ;THEN CONFIRM THE COMMAND
HALTF ;QUIT FOR THE NONCE
RET ;RETURN FOR A NEW COMMAND
;THE "HELP" COMMAND.
CMDHLP: CALL CONFRM ;CONFIRM THE LINE
HRROI T1,HLPTXT ;POINT TO HELP MESSAGE
PSOUT ;TYPE IT
RET ;AND RETURN
HLPTXT: TEXT<
SWSERR is a program designed to produce a compact listing of the
BUGxxx errors recorded in a SYSERR-format ERROR.SYS file. The
information provided is date and time, bug-type, bug-name, fork, job
and user number, program name, PI levels active, and username. The
listing format can include or suppress the various bug-types. The input
file may be specified if desired, and a time range selected. The final
summary counts the occurances of each BUGxxx and includes the
informational bug-string if available.
The commands are:
EXIT Exit from the program
HELP Type this text
INCLUDE Specify inclusion of BUGHLTs, BUGCHKs,
and BUGINFs or specific,
possibly wild, BUG names
IGNORE Specify exclusion of BUGHLTs, BUGCHKs,
and BUGINFs or specific,
possibly wild, BUG names
LIST Specify output file and begin processing
May be aborted with ^E
PUSH Push command level to a new EXEC
READ Specify alternate input ERROR.SYS format file
TAKE Take commands from specified file
TIME Set begin and end times for searching input
WHAT Tell current parameter settings
[End of SWSERR.HLP]
>
;PUSH COMMAND TO PUSH TO A NEW EXEC IN AN INFERIOR FORK
CMDPSH: MOVEI T2,[ASCIZ/COMMAND LEVEL/] ;GET NOISE
CALL NOISE ;PRINT IT
CALL CONFRM ;CONFIRM THE COMMAND
MOVX T1,GJ%PHY!GJ%OLD!GJ%SHT ;GTJFN BITS
HRROI T2,[ASCIZ/SYSTEM:EXEC.EXE/] ;FILENAME FOR EXEC
GTJFN ;GET A HANDLE ON THE FILE
ERJMP LOSE ;UNAVAILABLE???
MOVEM T1,JFNX ;SAVE JFN TO IT
MOVX T1,CR%CAP ;PRESERVE OUR CAPABILITIES
CFORK ;BUILD A FORK
ERJMP LOSE ;COULDN'T
MOVEM T1,HANDLE ;SAVE FORK HANDLE
MOVSS T1 ;HANDLE TO LEFT HALF
HRR T1,JFNX ;JFN TO RIGHT
GET ;GET THE FILE
ERJMP LOSE ;COULDN'T
MOVE T1,HANDLE ;FETCH FORK HANDLE
SETZ T2, ;NORMAL START
SFRKV ;START THE FORK UP
ERJMP LOSE ;CAN'T
WFORK ;WAIT FOR IT TO COME BACK
ERJMP LOSE ;TROUBLE
KFORK ;IS DONE, SO KILL IT
ERJMP LOSE ;FAILED
SETZM HANDLE ;NO MORE FORK
RET ; AND COMMAND IS FINISHED
;TAKE COMMAND TO READ COMMAND FROM DESIGNATED FILE BY SETTING UP
;THE PRIMARY I/O JFNS TO POINT TO THE FILE.
;UNTAKE ROUTINE CALLED TO RESET THE STATE WHEN THE END OF THE TAKE
;FILE IS ENCOUNTERED.
CMDTAK: HRROI T2,[ASCIZ/COMMANDS FROM FILE/] ;NOISE WORDS
CALL NOISE
HRROI T2,[ASCIZ/CMD/] ;DEFAULT EXTENSION FOR FILE
MOVEM T2,JFNBLK+.GJEXT
MOVX T2,GJ%OLD ;FILE MUST EXIST
MOVEM T2,JFNBLK+.GJGEN
MOVEI T2,[FLDDB. (.CMFIL)] ;ASK FOR A FILE
CALL COMMND
MOVE P1,T2 ;SAVE JFN FOR A MOMENT
CALL CONFRM ;CONFIRM THE COMMAND
SKIPE TAKJFN ;TEST--DON'T ALLOW NESTING
JRST [TMSG <
? Nesting of TAKE files is not allowed -- command file aborted
>
CALL UNTAKE ;CLEAR STATE AND
JRST REEN] ;DIE SOMEHOW
HRRZM P1,TAKJFN ;SAVE THE JFN
MOVE T1,TAKJFN ;GET BACK JFN
MOVX T2,7B5+OF%RD ;READ AS ASCII FILE
OPENF ;OPEN IT
ERJMP LOSE ;FAILED
MOVEI T1,.FHSLF ;OUR PROCESS
GPJFN ;GET OLD PRIMARY I/O
MOVEM T2,OLDPRM ;SAVE FOR RESTORE
HRL T2,TAKJFN ;POINT TO TAKE FILE
SPJFN ; AS PRIMARY INPUT
ERJMP LOSE ;COULDN'T
MOVX T2,.NULIO ;MARK COMND BLOCK OUTPUT
HRRM T2,CMDBLK+.CMIOJ ; AS NUL SO DON'T GET PROMPTS
RET ;AND DONE--RESET AT EOF BY UNTAKE
;UNTAKE ROUTINE CALLED TO UNDO THE EFFECTS OF THE TAKE COMMAND
;RESETS THE PRIMARY I/O AND CLEANS UP THE JFN.
UNTAKE: MOVEI T1,.PRIOU ;RESET COMND BLOCK OUTPUT DESIGNATOR
HRRM T1,CMDBLK+.CMIOJ ;SO WE GET OUR PROMPTS,... BACK
MOVEI T1,.FHSLF ;OUR PROCESS
SKIPE T2,OLDPRM ;OLD DESIGNATORS
SPJFN ;RESTORE
SETZM OLDPRM ;AND CLEAR
SKIPE T1,TAKJFN ;TAKE FILE JFN
CLOSF ;CLOSE IT
ERJMP .+1 ;IGNORE ERRORS (AND POSSIBLE LOSE LOOP)
SKIPE T1,TAKJFN ;GET JFN AGAIN
RLJFN ;RELEASE IT
ERJMP .+1
SETZM TAKJFN ;RESET TAKE STATE
RET ;DONE
SUBTTL WHAT COMMAND TO SHOW PARAMETER SETTINGS
;WHAT COMMAND TO TELL SWITCH SETTINGS
CMDWHT: MOVEI T2,[ASCIZ/ARE PARAMETER SETTINGS/] ;NOISE
CALL NOISE ;PROCESS IT
CALL CONFRM ;CONFIRM IT
CMDWH3: TXNN F,FL%TIM ;RANGES OF TIME?
JRST CMDWH4 ;NOT SET
TMSG<
Time Settings: Begin: > ;SET--TYPE THEM
MOVEI T1,.PRIOU
MOVE T2,BGNTIM
SETZ T3,
ODTIM
ERJMP LOSE
TMSG<
End: > ;AND END VALUE
MOVEI T1,.PRIOU
MOVE T2,ENDTIM
SETZ T3,
ODTIM
ERJMP LOSE
JRST CMDWH5 ;AND CONTINUE
CMDWH4: TMSG<
No Time Range Set> ;SAY NONE SET
CMDWH5: TXNE F,FL%IFS ;CHECK INPUT FILE SETUP
JRST CMDWH6 ;ONE SPECIFIED
TMSG<
Default Input Error File> ;NOT SET UP
JRST CMDWH7 ;AND CONTINUE
CMDWH6: TMSG<
Input Error File Specified: > ;PREFIX
HRROI T1,JFNSTR ;POINT TO FILENAME STRING
PSOUT ;TYPE IT
ERJMP LOSE
;...
CMDWH7: TMSG <
Listing includes:> ;FIRST PART
TXNE F,FL%HLT ;HLTS?
JRST [ TMSG < BUGHLTs>
JRST .+1] ;YUP
TXNE F,FL%CHK ;CHKS?
JRST [ TMSG < BUGCHKs>
JRST .+1] ;YES
TXNE F,FL%INF ;INFS?
JRST [ TMSG < BUGINFs>
JRST .+1] ;YES
TXNN F,FL%HLT!FL%CHK!FL%INF ;SEE IF ANY
JRST [ TMSG < Summary listing>
JRST .+1] ;JUST THE SUMMARY
SKIPN NAMTAB ;IF NO NAMES SET, THEN
RET ;RETURN
MOVN P1,NAMTAB ;BUILD AN
HRLZ P1,P1 ;AOBJN POINTER
HRRI P1,NAMTAB+1 ;TO INCLUDE STRINGS
CMDWLP: MOVEI T2,1 ;CHECK "NO" FLAG
HRROI T1,[ASCIZ/
INCLUDE /] ;ASSUME "YES"
TDNE T2,0(P1) ;IN B35 OF FIRST WORD OF STRING
HRROI T1,[ASCIZ/
IGNORE /] ;NO FLAG IS SET
PSOUT ;OUTPUT WHATEVER
HRROI T1,0(P1) ;POINT TO STRING
PSOUT ;TYPE IT
AOS P1 ;BUMP FOR TWO WORD ENTRY
AOBJN P1,CMDWLP ;LOOP TIL DONE
RET ;DONE
SUBTTL INCLUDE COMMAND TO VARY LISTING
;INCLUDE COMMAND TO MODIFY LISTING FORMAT FOR INCLUSION
CMDINC: MOVEI T2,[ASCIZ/IN LISTING/]
CALL NOISE ;PROCESS GUIDEWORDS
TXZ F,FL%NOF ;CLEAR "NO" FLAG
CMDINL: MOVEI T2,[FLDDB. (.CMKEY,,INCTAB,,,[
FLDDB. (.CMTXT,CM%SDH,,<Specific BUG name>)])]
CALL COMMND ;GET KEY
TSC T3,T3 ;SEE WHICH BLOCK WAS USED
JUMPN T3,GETSTR ;IT WAS THE SPECIFIC NAME ONE...
HRRZ P1,(T2) ;GET CODE RETURNED
CALL CONFRM ;CONFIRM THE COMMAND
TXNE F,FL%NOF ;"NO" FLAG SET?
ADDI P1,4 ;YUP, ADJUST TABLE INDEX
XCT INCXCT(P1) ;ADJUST LISTING BITS
RET ; AND ALL DONE HERE
;HERE TO PICK UP A SPECIFIC BUGNAME AND STORE IN NAMTAB
GETSTR: MOVE T2,[POINT 7,ATMBUF] ;POINTER TO INPUT
MOVE T1,NAMTAB ;GET FIRST FREE
IMULI T1,2 ;FOR TWO WORD ENTRIES
ADDI T1,NAMTAB+1 ;AND OFFSET FOR COUNT
MOVE T4,T1 ;COPY TO T4 FOR LATER
HRLI T1,(POINT 7,) ;FINALLY BUILD BYTE POINTER
MOVEI P1,6 ;COUNTER, SIX CHARS MAX
STRL: ILDB T3,T2 ;GET NEXT BYTE
JUMPE T3,STRFIN ;GO ON ENDING NULL
CAIE T3,.CHSPC ;SPACE?
CAIN T3,.CHTAB ; OR TAB?
JRST STRL ;YUP, SKIP IT
IDPB T3,T1 ;STORE
SOJG P1,STRL ;ONLY TAKE SIX
STRFIN: SETZ T3, ;TERMINATE WITH NULL
IDPB T3,T1 ;TO END STRING
MOVEI T2,1 ;USING 1B35 TO HOLD YES/NO
ANDCAM T2,0(T4) ;CLEAR
TXNE F,FL%NOF ;TEST FLAG
IORM T2,0(T4) ;"NO", SET NO FLAG
CALL CONFRM ;CONFIRM THE LINE
AOS NAMTAB ;ALLOCATE THE ENTRY, IT'S REAL
RET ;AND RETURN
SUBTTL IGNORE COMMAND TO MODIFY LISTING FORMAT
;IGNORE COMMAND TO EXCLUDE CATEGORIES OR SPECIFICS FROM LISTING
CMDIGN: MOVEI T2,[ASCIZ/IN LISTING/]
CALL NOISE ;DO GUIDEWORDS
TXO F,FL%NOF ;SET "NO" FLAG
CALLRET CMDINL ;AND DO THE WORK IN COMMON CODE WITH INCLUDE
INCTAB: INCLEN,,INCLEN
AA ALL,0 ;INCLUDE EVERYTHING
AA BUGCHKS,1
AA BUGHLTS,2
AA BUGINFS,3
INCLEN==.-INCTAB-1
INCXCT: CALL [ TXO F,FL%HLT!FL%CHK!FL%INF ;INCLUDE ALL
SETZM NAMTAB ;CLEAR INCLUDE TABLE
RET] ;DONE
TXO F,FL%CHK
TXO F,FL%HLT
TXO F,FL%INF
CALL [ TXZ F,FL%HLT!FL%CHK!FL%INF ;EXCLUDE ALL
SETZM NAMTAB ;CLEAR INCLUDE TABLE
RET] ;DONE
TXZ F,FL%CHK
TXZ F,FL%HLT
TXZ F,FL%INF
SUBTTL TIME COMMAND TO SET TIME RANGE
;TIME COMMAND TO SET BEGIN AND END THRESHOLDS
CMDTIM: MOVEI T2,[ASCIZ/TO START LISTING ENTRIES/]
CALL NOISE ;PROCESS IT
MOVEI T2,[FLDDB.(.CMCFM,,,,,[FLDDB.(.CMTAD,,CM%IDA+CM%ITM,,,[
FLDDB.(.CMTAD,,CM%IDA,,,[FLDDB.(.CMTAD,,CM%ITM)])])])]
CALL COMMND ;GET BEGIN
TSC T3,T3 ;CHECK FOR JUST A CRLF
JUMPE T3,[ TXZ F,FL%TIM ;YES--CLEAR TIME CHECKING
RET] ; AND DONE HERE
MOVEM T2,BGNTIM ;SAVE IT
MOVEI T2,[ASCIZ/AND END AT/] ;MORE NOISE
CALL NOISE ;TO PROMPT FOR END
MOVEI T2,[FLDDB.(.CMCFM,,,,,[FLDDB.(.CMTAD,,CM%IDA+CM%ITM,,,[
FLDDB.(.CMTAD,,CM%IDA,,,[FLDDB.(.CMTAD,,CM%ITM)])])])]
CALL COMMND ;ENDING VALUE
TXO F,FL%TIM ;REMEMBER
MOVEM T2,ENDTIM ;SAVE AWAY
TSC T3,T3 ;CHECK FOR JUST CRLF (FIRST FLDDB.)
JUMPE T3,[GTAD ; IF SO, USE NOW
MOVEM T1,ENDTIM ; AS ENDING TIME
RET] ;AND DONE
CALL CONFRM ;OTHERWISE CONFIRM THE LINE
RET ;AND RETURN
SUBTTL READ COMMAND TO SPECIFY ALTERNATE INPUT FILE
;READ COMMAND TO SET ALTERNATE INPUT FILE
CMDRED: MOVEI T2,[ASCIZ/ERROR DATA FROM/] ;NOISE
CALL NOISE ;PROCESS NOISE
MOVX T2,GJ%OLD ;FILE MUST EXIST
MOVEM T2,JFNBLK ;SET FLAGS
MOVEI T2,[FLDDB. (.CMIFI,,,,<SYSTEM:ERROR.SYS>)]
CALL COMMND ;PARSE INPUT FILENAME
MOVEM T2,JFNTMP ;SAVE THE INPUT JFN FOR LATER
CALL CONFRM ;CONFIRM THE LINE
TXO F,FL%IFS ;FILE SPECIFIED
HRROI T1,JFNSTR ;WHERE TO PUT THE STRING
MOVE T2,JFNTMP ;GET BACK THE JFN
MOVEM T2,IJFN ;AND SAVE IN IJFN
SETZB T3,T4 ;DEFAULT STRING
JFNS ;PUT IT IN STRING BLOCK
ERJMP LOSE ;FAILED
MOVE T1,IJFN ;AND PROCEED TO
RLJFN ; UNLOAD JFN, SAVING STRING
ERJMP LOSE ;FAILED
RET ;AND RETURN
SUBTTL LIST COMMAND TO DO IT
;LIST COMMAND TO SET OUTPUT FILE AND BEGIN
CMDLST: MOVEI T2,[ASCIZ/OUTPUT ON FILE/] ;NOISE
CALL NOISE ;PROCESS IT
MOVEI T2,[FLDDB. (.CMOFI,,,,<TTY:>)] ;SETUP
CALL COMMND ;READ OUTPUT SPEC
MOVEM T2,JFNTMP ;STORE JFN FOR OUTPUT
MOVEI T2,[ASCIZ/AND BEGIN PROCESSING/]
CALL NOISE ;FINAL NOISE
CALL CONFRM ;CONFIRM THE LINE
MOVE T1,JFNTMP ;PICK UP THE SAVED JFN
MOVEM T1,OJFN ; AND ESTABLISH IT AS THE OUTPUT JFN
MOVEM P,SAVEL ;PRESERVE P IN CASE ABORT OCCURS
MOVE T1,[.TICCE,,INTCHN] ;ACTIVATE ABORT ON ^E
ATI
CALL PROCES ;DO THE JOB
LSTDON: MOVX T1,.TICCE ;^E CODE
DTI ;DISABLE INTERRUPTING ON IT
ERJMP LOSE
RET ;AND RETURN FOR ANOTHER COMMAND
;HERE ON A CONTROL-E INTERRUPT TO ABORT THE LIST COMMAND IN PROGRESS
LSTINT: MOVEI T1,LSTABT ;ADDRESS OF WHERE TO GO
MOVEM T1,CHNPC1 ;IN PLACE OF RETURNING
DEBRK ;TERMINATE THE INTERRUPT
ERJMP LOSE ;FAILED
;DEBRK TRANSFERS CONTROL TO HERE TO ABORT THE LIST COMMAND
LSTABT: MOVEI T1,.PRIOU ;PRESUME TO CLEAR
CFOBF ; THE OUTPUT IN CASE GOING TO TTY
ERJMP LOSE
TMSG <
Listing Aborted
> ;YIELD UP AN ACKNOWLEDGEMENT
TXZ F,FL%OFO ;ABORT CLOSE THE FILES
MOVX T1,CZ%ABT+.FHSLF; FOR THE JOB
CLZFF
ERJMP LOSE
MOVE P,SAVEL ;ADJUST STACK BACK FOR ABORT
JRST LSTDON ; AND FINISH UP THE COMMAND
SUBTTL THE MAIN PROCESSING LOOP
PROCES: MOVX T1,GJ%OLD+GJ%SHT ;GETJFN BITS
HRROI T2,[ASCIZ/SYSTEM:ERROR.SYS/] ;ASSUME DEFAULT
TXNE F,FL%IFS ;SPECIAL FILE SPECIFIED?
HRROI T2,JFNSTR ;YES--POINT TO IT
GTJFN ;TRY TO GET IT
ERJMP LOSE ;FAILED
MOVEM T1,IJFN ;SAVE JFN
PROC1: MOVE T1,IJFN ;GET INPUT JFN
MOVX T2,^D36B5+OF%RD ;TO READ
OPENF ;OPEN IT
ERJMP LOSE ;FAILED
MOVE T1,OJFN ;NOW TRY OUTPUT JFN
MOVX T2,^D7B5+OF%WR ;TO WRITE IN ASCII
OPENF ;OPEN IT
ERJMP LOSE ;FAILED
TXO F,FL%OFO ;MARK AS OPEN
TMSG<
[ PROCESSING > ;SAY WHO
PSOUT ;WE ARE DOING
MOVEI T1,.PRIOU ;OUTPUT TO USER
MOVE T2,IJFN ;INPUT FILE JFN
SETZB T3,T4 ;JFNS ARGS
JFNS ;SAY WHICH FILE
ERJMP LOSE ;FAILED
TMSG< ]
> ;AND A CRLF
SETOM LINENO ;INIT LINE COUNTER
SETZM PAGENO ;INIT PAGE NUMBER
TXO F,FL%FDO ;FORCE DATE OUTPUT
SETZB T1,T2 ;ZERO SOME STUFF
SETZ T3, ;TO INDICATE MIDNIGHT
IDCNV ;GET LOCAL MIDNITE
ERJMP LOSE ;FAILED
HRROM T2,LSTDAT ;SET DATE PRINTING THRESHOLD
MOVEI T1,POOL ;INITIALIZE
MOVEM T1,FREPTR ; FREE POOL POINTER
MOVEI T1,SUMSIZ ;SIZE OF SUMMARY TBLUK TABLE
MOVEM T1,SUMTAB ;INIT THE TABLE TO EMPTY
CALL FILINI ;INIT INPUT FILE POINTERS
;...
PROCLP: CALL NXTENT ;GET NEXT ENTRY TO BUFFER
JRST PROCFN ;END OF FILE OR OTHER TERMINATION
MOVE P1,HDRTIM ;MAKE
CALL TIMCHK ; CHECK OF TIME
JRST PROCSM ;UNWANTED--BUT SUMMARIZE
MOVE P1,[POINT 7,BUGNAM] ;GET THE PARTICULAR NAME
CALL NMYCHK ;REALLY WANT THIS ONE?
SKIPA ;NOT ESPECIALLY
JRST PROCLY ;YES, DO IT.
MOVE P1,[POINT 7,BUGNAM] ;GET THE PARTICULAR NAME
CALL NMNCHK ;REALLY WANT TO FORGET THIS ONE?
JRST PROCSM ;YES, FORGET IT
MOVE P1,BUGFLG ;GET TYPE FLAGS
CALL TYPCHK ;SEE IF INCLUDING
JRST PROCSM ;UNWANTED, BUT SUMMARIZE
;HERE WE REALLY WANT TO PRINT THIS ENTRY, SO DO SO
PROCLY: CALL TSTPAG ;WANT THIS ONE--
SKIPGE P1,BUGDAT ;GET BUG TIME IF SET
MOVE P1,HDRTIM ; ELSE USE ENTRY WRITTEN TIME
CALL DATOUT
SPACE 1
MOVE P1,BUGFLG ;GET THE BUG TYPE
CAIN P1,BG%HLT ;HLT?
JRST [ FMSG <HLT > ;YES, SAY SO
JRST PROCL1] ;AND CONTINUE
CAIN P1,BG%CHK ;CHK?
JRST [ FMSG < CHK > ;YES
JRST PROCL1] ;CONTINUE
CAIN P1,BG%INF ;INF?
JRST [ FMSG < INF> ;YES
JRST PROCL1] ;CONTINUE
PROCL1: SPACE 1
HRROI T2,BUGNAM ;POINT TO THE NAME
MOVEI T3,7 ;SIX CHARACTERS
SETZM T4 ;ASCIZ
SOUT ;OUTPUT IT
ERJMP LOSE
AOS P1,T3 ;ACCOUNT FOR THE REMAINING
DVCHR ;SEE IF OUTPUT TO TTY
ERJMP LOSE
MOVE T1,OJFN ;SETUP JFN AGAIN
LOAD T2,DV%TYP,T2 ;DEVICE TYPE
CAIE T2,.DVTTY ;IF TTY OR
CAIN T2,.DVPTY ;PTY THEN
SKIPA ;DON'T BKJFN
BKJFN ;BACK OVER NULL (FOR FILES)
ERJMP .+1 ;IGNORE ANY ERROR (LIKE TTYS)
CALL SPCOUT ; SPACES NEEDED
;...
HLRE T2,BUGJOB ;GET FORK NUMBER
JUMPL T2,[FMSG < ---> ;FORK NOT GIVEN
JRST PROCL2];CONTINUE
MOVX T3,NO%MAG+NO%LFL+FLD(4,NO%COL)+^D8
NOUT ;OCTAL FORK NUMBER
ERJMP LOSE
PROCL2: SPACE 1
HRRE T2,BUGJOB ;GET JOB NUMBER
JUMPL T2,[FMSG <---> ;JOB NOT GIVEN
JRST PROCL3];CONTINUE
MOVX T3,NO%LFL+FLD(3,NO%COL)+^D10
NOUT ;DECIMAL JOB NUMBER
ERJMP LOSE
PROCL3: SPACE 1
HRRZ T2,BUGUSR ;USER NUMBER
JUMPE T2,[FMSG < ---> ;NONE APPROPRIATE
JRST PROCL4];CONTINUE
MOVX T3,NO%MAG+NO%LFL+FLD(^D4,NO%COL)+^D8
NOUT ;OUTPUT OCTAL USER NUMBER
ERJMP LOSE
PROCL4: SPACE 2
SKIPN P1,BUGPNM ;PROGRAM NAME
MOVE P1,[SIXBIT/ -- /] ;CHANGE IF NOT GIVEN
CALL SIXOUT ;OUTPUT SIXBIT PROGRAM NAME
PROCL6: SPACE 1
LOAD T3,BUGPI ;GET THE CURRENT PI LEVEL
ROT T3,-7 ;MOVE TO BITS 0-6
MOVSI T4,-7 ;NUMBER OF LEVELS
PROCL7: MOVEI T2,.CHSPC ;SPACE
SKIPGE T3 ;PI LEVEL IN PROGRESS?
MOVEI T2,"1"(T4) ;YES, GET THE DIGIT
BOUT ;OUTPUT SPACE OR LEVEL
ERJMP LOSE
LSH T3,1 ;AND SHIFT UP A BIT
AOBJN T4,PROCL7 ; THEN LOOP
SPACE 4
SKIPE T2,BUGUSR ;USER NUMBER AGAIN
DIRST ;PRINT IT
ERJMP [MOVE T1,OJFN ;RESET OUTPUT JFN
FMSG <(DIRST Error)> ;NOTE
JRST .+1] ;CONTINUE IN LINE WITHOUT A NAME
CALL CRLF ;OUTPUT CRLF
;...
PROCSM: MOVEI T1,SUMTAB ;SETUP THE TBLUK TABLE
MOVE T2,[POINT 7,BUGNAM] ;POINT TO THE NAME
TBLUK ;SEE IF IT'S THERE
TXNE T2,TL%EXM ;EXACT MATCH?
JRST [ HRRZ T1,0(T1) ;FETCH RH POINTER TO COUNT, MSG BLOCK
AOS 0(T1) ;COUNT UP ANOTHER REFERENCE
JRST PROCS2] ;AND CONTINUE TO LOOP
;HERE WE HAVE A NEW ENTRY, SO BUILD THE COUNT, MESSAGE BLOCK AND DO
;A TBADD TO PUT IT INTO THE TABLE.
MOVEI T1,2 ;NUMBER OF WORDS FOR BUG NAME STRING
ADDB T1,FREPTR ;ALLOCATE THE SPACE
DMOVE T3,BUGNAM ;PICK UP THE NAME
DMOVEM T3,-2(T1) ; AND STORE IN FREE POOL
MOVE P4,FREPTR ;SAVE THE START OF THE BLOCK
MOVEI T1,1 ;INITIAL REFERENCE COUNT
MOVEM T1,0(P4) ;SET IT
HRLI T1,BUGMSG ;SOURCE OF MESSAGE
HRRI T1,1(P4) ;DESTINATION
BLT T1,MSGSIZ+1(P4) ;BLT MESSAGE
MOVEI T1,MSGSIZ+1 ; AND FINALLY ALLOCATE
ADDM T1,FREPTR ; THE SPACE
MOVEI T1,SUMTAB ;POINT TO THE TABLE
HRLI T2,-2(P4) ;BUGNAME POINTER IN LH
HRR T2,P4 ;COUNT, MESSAGE POINTER IN RH
TBADD ;ADD THE ENTRY
ERJMP LOSE ;AWFUL ERROR LIKE TABLE FULL
PROCS2: JRST PROCLP ;AND LOOP
;HERE AFTER PROCESSING THE INPUT FILE
PROCFN: CALL SUMOUT ;PRINT THE SUMMARY
MOVE T1,IJFN ;INPUT JFN
CLOSF ;CLOSE
ERJMP LOSE
MOVE T1,OJFN ;OUTPUT JFN
CLOSF ;SAME
ERJMP LOSE
TXZ F,FL%OFO ;MARK AS NOT OPEN
RET ;AND DONE
SUBTTL ENTRY INPUT AND VALIDATION ROUTINES
;ALL ROUTINES HERE RETSKP IF VALID AND RET IF ENTRY IS UNWANTED
;TIMCHK VERIFY ENTRY TIME IN P1 IN RANGE
TIMCHK: TXNN F,FL%TIM ;DO WE CARE?
RETSKP ;NO
CAML P1,BGNTIM ;TOO EARLY
CAMLE P1,ENDTIM ; OR TOO LATE?
RET ;YUP
RETSKP ;IN RANGE
;TYPCHK - VERIFY ENTRY TYPE WANTED (HLT/CHK/INF) AGAINST TYPE IN P1
TYPCHK: MOVE T1,[FL%CHK ;GET BIT CORRESPONDING TO TYPE
FL%INF
FL%HLT]-1(P1)
TDNE F,T1 ;SEE IF WE WANT IT
RETSKP ;WANT IT
RET ;SUPPRESSING
;NMYCHK - VERIFY PARTICULAR NAME WANTED, POINTER TO NAME IN P1
NMYCHK: CALL NAMCHK ;CALL THE REAL ROUTINE
JUMPG T1,RSKP ;T1 POSITIVE MEANS "YES" MATCH
RET ;ELSE NO OR DON'T CARE
;NMNCHK - VERIFY PARTICULAR NAME NOT WANTED, POINTER TO NAME IN P1
NMNCHK: CALL NAMCHK ;CALL THE REAL ROUTINE
JUMPL T1,R ;T1 NEGATIVE MEANS "NO" MATCH
RETSKP ;ELSE YES OR DON'T CARE
;NAMCHK - DO WILD NAME MATCHING LOOKUP.
;CALL WITH POINTER TO NAME IN P1.
;RETURNS WITH T1/ -1 ON A "NO" MATCH
; 0 ON A "DON'T CARE"
; +1 ON A "YES" MATCH
;MAKES ALL CHECKS, IN ORDER, USES T1-T4.
NAMCHK: SETZM T4 ;SET SENSE FLAG TO DON'T CARE
MOVE T3,P1 ;STRING TO CHECK
SKIPN P1,NAMTAB ;GET COUNT IN P1
JRST [ MOVE P1,T3 ;NONE, RESTORE P1,
SETZM T1 ; SET "DON'T CARE"
RET] ; AND RETURN
MOVN P1,P1 ;BUILD UP AN
HRLZ P1,P1 ; AOBJN POINTER IN P1
NMCHLP: HRROI T2,NAMTAB+1(P1) ;POINT TO WILD STRING
MOVX T1,.WLSTR ;STRING CHECK FUNCTION
WILD% ;MAKE THE CHECK
ERJMP LOSE
JUMPN T1,NMCHLX ;CONTINUE ON NO MATCH
MOVEI T1,1 ;WE ARE USING 1B35 AS THE YES/NO FLAG
MOVEM T1,T4 ;ASSUME "YES" MATCH
TDNE T1,NAMTAB+1(P1) ;BUT CHECK ANYWAY
SETOM T4 ;IT WAS A "NO" MATCH
NMCHLX: AOS P1 ;BUMP FOR TWO WORD ENTRY
AOBJN P1,NMCHLP ; AND LOOP TIL DONE
MOVE P1,T3 ;RESTORE P1
MOVE T1,T4 ;AND SET SENSE FLAG IN T1
RET ;THEN RETURN
;FILINI INITIALIZE INPUT FILE...
FILINI: MOVEI T1,1 ;ADDRESS OF FIRST HEADER WORD
MOVEM T1,HDRADR ;INIT HDRADR
SETZM HDRWRD ;AND FAKE HDRWRD SO WILL BEGIN AT START
RET ;AND RETURN
;NXTENT READ IN THE NEXT ENTRY. RETSKP OK, RET ON EOF.
NXTENT: LOAD T2,HDRLEN ;HEADER LENGTH
LOAD T1,ENTLEN ;ENTRY LENGTH
ADD T2,T1 ;COMBINE
CALL GETWRD ;READ NEXT HEADER
RET ;EOF???
LOAD T1,HDRCOD ;GET TYPE CODE
CAIE T1,HF.ERR ;IS IT AN ERROR MARKER
CAIN T1,HF.EOF ; OR THE NORMAL EOF MARKER?
RET ;YES
MOVEM T3,HDRADR ;SET NEW HEADER ADDRESS
MOVEM T2,HDRWRD ;SET NEW HEADER WORD
LOAD T1,HDRVER ;GET VERSION
CAIE T1,HF.VER ;ONE WE KNOW?
JRST LOST ;NO--SANITY CHECK LOSES
MOVE T1,HDRWRD ;WORD
TXNN T1,HF.T20 ;TOPS-20 ENTRY?
JRST LOST ;NO--SANITY CHECK LOSES
LOAD T1,HDRCOD ;GET TYPE CODE
CAIE T1,SEC%BG ;BUGXXX ENTRY?
JRST NXTENT ;NO--LOOP
CALL RDENT ;OK, SO READ VALUES
RETSKP ;AND RETURN SKIP
LOST: TMSG<
% LOST SYNCHRONIZATION--ATTEMPTING TO CONTINUE
> ;SAY OOPS
MOVE T1,HDRADR ;GET CURRENT ADDRESS
ADDI T1,^D128 ;MOVE TO NEXT BLOCK
TRZ T1,177 ;AND ROUND BACK TO BEGINNING
MOVEM T1,HDRADR ;THEN STORE BACK
MOVEI T2,0 ;ZERO OFFSET
CALL GETWRD ;READ THE POINTER WORD AT START OF BLOCK
RET ;APPARENTLY END OF FILE...
HRRZS T2 ;OFFSET IS IN THE RIGHT HALF
ADDM T2,HDRADR ;POINT TO START OF NEXT ENTRY
SETZM HDRWRD ;NO FURTHER OFFSETS
JRST NXTENT ; AND TRY THE NEXT ENTRY
;RDENT - READ IN THE DATA FOR THE CURRENT ENTRY
RDENT: MOVEI T2,HDRDAT ;GET DATE-TIME
CALL GETWRD
JRST OOPS
MOVEM T2,HDRTIM ;SAVE IT
LOAD T2,HDRLEN
ADDI T2,BG%FLG ;GET FLAGS TYPE WORD
CALL GETWRD
JRST OOPS
MOVEM T2,BUGFLG ;STORE
LOAD T2,HDRLEN
ADDI T2,BG%JOB ;GET FORK,,JOB WORD
CALL GETWRD
JRST OOPS
MOVEM T2,BUGJOB ;STORE
LOAD T2,HDRLEN
ADDI T2,BG%USR ;USER NUMBER
CALL GETWRD
JRST OOPS
MOVEM T2,BUGUSR ;STORE
LOAD T2,HDRLEN
ADDI T2,BG%PNM ;USER PROGRAM NAME
CALL GETWRD
JRST OOPS
MOVEM T2,BUGPNM ;STORE
SETZB T1,T2 ;PRE-CLEAR
DMOVEM T1,BUGNAM ;THE NAME WORDS
LOAD T2,HDRLEN
ADDI T2,BG%NAM ;GET BUG NAME
CALL GETWRD
JRST OOPS
MOVE T3,[POINT 7,BUGNAM] ;WHERE TO PUT THE STRING
RDENTN: SETZ T1, ;ZERO
LSHC T1,6 ;THEN SHIFT UP A BYTE
ADDI T1," " ;MAKE ASCII
IDPB T1,T3 ;STASH IT IN NAME STRING
JUMPN T2,RDENTN ; AND LOOP TIL DONE
;...
;...
LOAD T2,HDRLEN
ADDI T2,BG%DAT ;GET DATE/TIME OF BUG
CALL GETWRD
JRST OOPS
MOVEM T2,BUGDAT ;STORE
LOAD T2,HDRLEN
ADDI T2,BG%PIS ;CONI PI, WORD
CALL GETWRD
JRST OOPS
MOVEM T2,BUGPIS ;STORE
LOAD T2,HDRLEN
ADDI T2,BG%MSG ;POINTER TO MESSAGE
CALL GETWRD
JRST OOPS
JUMPE T2,[SETZM BUGMSG ;NO POINTER MEANS NO MESSAGE
JRST NMSGDN] ;CONTINUE
MOVE P1,T2 ;SAVE THE POINTER
SETZ P2,0 ;OFFSET IN BUGMSG STORE
NMSGLP: LOAD T2,HDRLEN
ADD T2,P1 ;NEXT WORD OF MESSAGE
CALL GETWRD
JRST OOPS
MOVEM T2,BUGMSG(P2) ;SAVE IT
AOS P2
TXNE T2,177B34 ;TRAILING NULL?
AOJA P1,NMSGLP ;NOPE, GET NEXT
NMSGDN: RET ;AND RETURN
OOPS: TMSG <
? UNEXPECTED END-OF-FILE ON INPUT>
JRST LOSE ;AND CYCLE
;GETWRD - ROUTINE TO RETURN DESIRED WORD FROM INPUT FILE
;CALLED WITH OFFSET FROM THE BEGINNING OF THE HEADER IN T2.
;RETURNS THE DESIRED WORD IN T2 RETSKP. NONSKIP FOR END-OF-FILE.
;RETURNS WORD ADDRESS IN T3.
;COMPUTES THE ADJUSTMENTS NEEDED TO ACCOMODATE THE SYNCH WORD AT
;THE START OF EVERY 128-WORD BLOCK.
GETWRD: MOVE T1,HDRADR ;HEADER ADDRESS
ADD T2,T1 ;PLUS OFFSET
LSH T1,-7 ;DIVIDE BY BLOCKSIZE
MOVE T3,T2 ;COPY FOR ADJUST
LSH T3,-7 ;DIVIDE BY BLOCKSIZE
SUB T3,T1 ;COUNT BLOCK CROSSINGS
ADD T3,T2 ;UPDATE ADDRESS FOR PROPER ADJUSTMENT
XOR T2,T3 ;AND CHECK TO SEE IF THE ADJUSTMENT
TRNE T2,200 ; PUSHED US ACROSS ANOTHER BOUNDARY
AOS T3 ;IT DID, ADD THE (FINAL!) ADJUSTMENT.
MOVE T1,IJFN ;INPUT JFN
RIN ;READ THE WORD
ERJMP CHKEOF ;WATCH FOR EOF
RETSKP ;RETURN
CHKEOF: GTSTS ;GET STATUS BITS
TXNN T2,GS%EOF ;END OF FILE?
JRST LOSE ;NO--SOME ERROR
RET ;YES--NONSKIP
SUBTTL OUTPUT CONVERSION ROUTINES
;DATOUT OUTPUT THE DATE-TIME PASSED IN P1.
DATOUT: MOVE T1,OJFN ;JFN
MOVE T2,P1 ;THE DATE-TIME
SETZ T3, ;DEFAULT FORMAT
TXNE F,FL%FDO ;FORCED?
JRST DATOU1 ;YES--MAKE SURE THRESHOLD OK
CAMGE T2,LSTDAT ;PAST THRESHOLD?
JRST [ PUSH P,T2 ;SAVE ACROSS CALL
SPACE 12 ; DO SPACING
POP P,T2 ;RESTORE
JRST DATOU2] ;AND CONTINUE
TXO F,FL%FDO ;YES, FORCE DATE OUT
DATOU1: HLLM T2,LSTDAT ;UPDATE THE THRESHOLD
MOVSI T4,1 ; AND ADJUST IT
CAML T2,LSTDAT ; TO BE CORRECT
ADDM T4,LSTDAT ; FOR NEXT DAY
DATOU2: TXZN F,FL%FDO ;FORCING?
TXO T3,OT%NDA ;NO--SUPPRESSING
ODTIM ;DO IT
ERJMP LOSE ;FAILED
RET ;DONE
;SPCOUT OUTPUT NUMBER OF SPACES SPECIFIED IN P1 (0 TO 39.)
SPCOUT: MOVE T1,OJFN ;JFN FOR OUTPUT
HRROI T2,[ASCIZ/ /]
MOVN T3,P1 ;SOUT COUNT
SOUT ;OUTPUT THE SPACES
ERJMP LOSE ;FAILED
RET ;DONE
;CRLF OUTPUT A CRLF
CRLF: MOVE T1,OJFN ;JFN FOR OUTPUT
FMSG <
> ;OUTPUT THE CRLF
ERJMP LOSE
RET ;AND RETURN
;SIXOUT - ROUTINE TO OUTPUT A WORD IN SIXBIT TO THE SELECTED JFN
;ACCEPTS
; P1/ VALUE TO BE OUTPUT
; CALL SIXOUT
;RETURNS +1: ALWAYS. ALWAYS OUTPUTS SIX CHARACTERS
;USES T1-T4.
SIXOUT: MOVE T1,OJFN ;GET THE SELECTED JFN
SIXWRD: MOVE T3,P1 ;COPY THE WORD
MOVEI T4,6 ;NUMBER OF CHARACTERS TO DO
SIXWRL: SETZ T2, ;CLEAR T2
LSHC T2,6 ;SHIFT UP A BYTE
ADDI T2," "-' ' ;MAKE INTO ASCII
BOUT ;OUTPUT THE CHARACTER
SOJG T4,SIXWRL ;AND LOOP FOR SIX
RET ; THEN RETURN
SUBTTL PAGE HEADER PRINTING ROUTINE
;TSTPAG ROUTINE CALLED PRIOR TO OUTPUTTING A LINE. TESTS LINENO AND
; PUTS OUT A NEW PAGE HEADER WHEN THE COUNTER EXPIRES.
TSTPAG: AOSE LINENO ;HEADER TIME
RET ;NOT YET
AOS PAGENO ;NEW PAGE
MOVE T1,OJFN ;OUTPUT JFN
MOVEI T2,.CHFFD ;FORM FEED
BOUT
ERJMP LOSE
HRROI T2,[ASCIZ\
SWSERR %\]
SETZ T3, ;ASCIZ
SOUT
ERJMP LOSE
CALL VEROUT ;OUTPUT OUR VERSION NUMBER
MOVEI T2,.CHTAB ;AND A TAB
BOUT
ERJMP LOSE
SETO T2, ;-1=NOW
ODTIM ;DATE AND TIME
ERJMP LOSE
HRROI T2,[ASCIZ\ PAGE \]
SETZ T3, ;ASCIZ
SOUT
ERJMP LOSE
MOVE T2,PAGENO ;AND FINALLY THE PAGE NUMBER
MOVE T3,[NO%MAG+NO%LFL+^D2B17+^D10] ;DECIMAL, 2 DIGIT
NOUT
ERJMP LOSE
HRROI T2,[ASCIZ\
Date Time Type Name Fork Job User Program PIs-Active Username
\] ;COLUMN HEADER
SETZ T3, ;ASCIZ
SOUT
ERJMP LOSE
MOVNI T1,PAGSIZ ;RESET COUNTER
MOVEM T1,LINENO ; FOR NEXT TIME
TXO F,FL%FDO ;FORCE THE DATE ON FIRST LINE
RET ;AND RETURN
SUBTTL VERSION NUMBER PRINTING
;VEROUT PRINT OUT THE ASSEMBLED-IN VERSION NUMBER. (T1 ALREADY SET UP)
VEROUT: MOVEI T3,10 ;NOUT FORMAT, OCTAL
MOVEI T2,VMAJOR ;MAJOR VERSION LEVEL
SKIPE T2 ;SKIP IF ZERO
NOUT ; ELSE PRINT
ERJMP LOSE ;FAILED
MOVEI T2,VMINOR+"A"-1 ;LETTER FOR MINOR VERSION
CAIE T2,"A"-1 ;DON'T BOTHER IF ZERO
BOUT ; ELSE DO IT
ERJMP LOSE
MOVEI T2,"(" ;PARENS FOR EDIT LEVEL
BOUT
ERJMP LOSE
MOVEI T2,VEDIT ;ALWAYS DO EDIT NUMBER
NOUT
ERJMP LOSE
MOVEI T2,")" ;CLOSING PAREN
BOUT
ERJMP LOSE
MOVEI T4,VWHO ;LAST EDITOR
JUMPE T4,R ;DONE IF ZERO
MOVEI T2,"-" ; ELSE DO NUMBER
BOUT ; AFTER DASH
ERJMP LOSE
MOVEI T2,VWHO ;GET WHO BACK
NOUT ;OUTPUT
ERJMP LOSE
RET ;AND DONE
SUBTTL SUMMARY PRINTING ROUTINE
;SUMOUT - ROUTINE TO OUTPUT THE SUMMARY LISTING
SUMOUT: MOVE T1,OJFN ;LOAD UP THE OUTPUT JFN
HLRZ P2,SUMTAB ;GET THE IN-USE COUNT OF THE TABLE
JUMPE P2,[TMSG <
%No entries to summarize
> ;SAY SOMETHING IF NONE
RET] ; AND RETURN
MOVNS P2 ;NEGATE COUNT
HRLZI P2,0(P2) ; AND PUT IN LH FOR AOBJN COUNTER
MOVEI T2,.CHFFD ;GET A FORM-FEED
BOUT ; AND START A NEW PAGE
ERJMP LOSE
FMSG <
Summary of BUG Occurances at >
SETOM T2 ;CURRENT TIME
SETZM T3 ;DEFAULT WAY
ODTIM ;DO THE DATE TIME
ERJMP LOSE
FMSG <
Occurances BUG Name BUG Message
> ;HEADER
MOVX T1,GJ%SHT+GJ%OLD ;GET A HANDLE ON BUGSTRINGS FILE
HRROI T2,[ASCIZ/SYSTEM:BUGSTRINGS.TXT/]
GTJFN ;TRY TO GET IT
ERJMP [SETZM T1 ;FAILED, TOUGH...
JRST .+1] ;CONTINUE IN LINE...
MOVEM T1,BUGJFN ;SAVE JFN
MOVX T2,7B5+OF%RD ;READ IN ASCII BYTES
OPENF ;OPEN THE FILE
ERJMP [MOVE T1,BUGJFN ;GET BACK JFN
SETZM BUGJFN ;MARK NOT IN USE
RLJFN ;TRY TO UNLOAD
ERJMP .+1 ;IGNORE FAILURE HERE
JRST .+1] ;CONTINUE IN LINE...
;...
SUMOLP: SPACE 3
HRRZ P3,SUMTAB+1(P2) ;GET THE NEXT TABLE ENTRY RH
MOVE T2,0(P3) ;FETCH THE OCCURANCE COUNT
MOVX T3,NO%MAG+NO%LFL+FLD(5,NO%COL)+^D10
NOUT ;OUTPUT IN DECIMAL
ERJMP LOSE
SPACE 5
HLRO T2,SUMTAB+1(P2) ;-1,,[ASCIZ/BUGNAME/]
MOVEI T3,7 ;SIX CHARS MAX
SETZM T4 ;ASCIZ
SOUT ;OUTPUT THE STRING
ERJMP LOSE
MOVEI P1,3(T3) ;MAKE JUSTIFICATION
DVCHR ;SEE IF OUTPUT TO TTY
ERJMP LOSE
MOVE T1,OJFN ;SETUP JFN AGAIN
LOAD T2,DV%TYP,T2 ;DEVICE TYPE
CAIE T2,.DVTTY ;IF TTY OR
CAIN T2,.DVPTY ;PTY THEN
SKIPA ;DON'T BKJFN
BKJFN ;BACK OVER NULL (FOR FILES)
ERJMP .+1 ;IGNORE ANY ERROR (LIKE TTYS)
CALL SPCOUT ;AND DO SPACING
HRRO T2,SUMTAB+1(P2) ;POINT TOWARDS MESSAGE
AOS T2 ;WHICH IS ACTUALLY IN NEXT WORD
SKIPN 0(T2) ;SEE IF ANYTHING THERE
CALL GETMSG ;TRY TO GET THE MESSAGE FROM BUGSTRINGS.TXT
SETZM T3 ;ASCIZ
SOUT ;OUTPUT THE STRING
ERJMP LOSE
HRRO T2,SUMTAB+1(P2) ;POINT TOWARDS MESSAGE FROM SYSERR BLOCK
SKIPE 1(T2) ;SEE IF ANYTHING THERE
CALL CRLF ;END THE LINE IF MESSAGE FROM SYSERR BLOCK
AOBJN P2,SUMOLP ; AND LOOP TIL DONE
MOVE T1,BUGJFN ;JFN ON FILE
CLOSF ;GET RID OF IT
ERJMP .+1 ;IGNORE ERRORS HERE
RET ; THEN RETURN
;GETMSG - ATTEMPT TO READ THE BUG MESSAGE FOR THIS BUG FROM BUGSTRINGS.TXT
GETMSG: SAVEAC <T1> ;SAVE CALLER'S DESIGNATOR
SKIPN T1,BUGJFN ;SEE IF ANY FILE TO USE
JRST NOBGMS ;BIG LOSE MESSAGE
SETZM T2 ;RESET TO BEGINNING
SFPTR ;OF BUGSTRINGS FILE
ERJMP NOBGMS ;FLICK IT...
BGMSLP: MOVE T1,BUGJFN ;GET JFN AGAIN
HRROI T2,BUGBUF ;WHERE TO READ IT
MOVX T3,100*5-1 ;MAX NUMBER OF BYTES
MOVX T4,.CHLFD ;TERMINATE ON LINEFEEDS
SIN ;READ A LINE
ERJMP NOBGMS ;FLICK IT IF DIDN'T WORK OR EOF...
SETZM T1 ;GET A NULL
IDPB T1,T2 ;AND FINISH LINE WITH IT
HLRO T1,SUMTAB+1(P2) ;POINT TO BUG NAME
HRROI T2,BUGBUF ;POINT TO BUGSTRINGS LINE
STCMP ;SEE IF STRINGS MATCH
ERJMP NOBGMS ;FLICK IT IF ERRORS...
TXNN T1,SC%SUB ;SUBSTRING MATCH?
JRST BGMSLP ;NO, LOOP MORE
MOVX T3,7 ;YES! NUMBER OF BYTES TO
ADJBP T3,T2 ;ADJUST BY
MOVE T2,T3 ;PUT POINTER IN T2
RET ;AND RETURN
NOBGMS: HRROI T2,[ASCIZ/ (No message available for this BUG)
/]
RET ;RETURN WITH LOSER MESSAGE
SUBTTL ERROR PROCESSING AND COMND HELPER ROUTINES
LOSE: SKIPE T1,TAKJFN ;TAKE IN PROGRESS?
JRST [ GTSTS ;YES--SEE IF EOF
TXNE T2,GS%EOF ;TEST BIT
JRST TAKEOF ;EOF
JRST .+1] ;OTHER ERROR, CONTINUE
MOVE T1,OJFN ;TRY TO CLOSE OUTPUT
TXZE F,FL%OFO ; OUTPUT FILE IF
CLOSF ; HAPPENED TO BE OPEN
ERJMP .+1 ;TOO BAD ON CLOSE ERRORS
HRROI T1,[ASCIZ/
? /] ;GET PRELIMINARY TEXT
PSOUT ;TYPE IT
MOVEI T1,.PRIOU ;OUTPUT TO TERMINAL
HRLOI T2,.FHSLF ;LAST ERROR IN THIS FORK
SETZ T3, ;ALL OF THE TEXT
ERSTR ;PRINT THE ERROR
JFCL ;FAILED
JFCL ;FAILED
SKIPN TAKJFN ;NEED TO ABORT TAKE?
JRST LOSFIN ;NO
CALL UNTAKE ;YES--SO DO IT
TMSG < -- command file aborted> ;AND SAY SO
LOSFIN: HRROI T1,[ASCIZ/
/] ;GET FINAL STRING
PSOUT ;TYPE IT TOO
MOVEI T1,.PRIIN ;GET READY
CFIBF ;CLEAR INPUT BUFFER
JRST REEN ;AND START OVER
TAKEOF: CALL UNTAKE ;CLEAN UP TAKE STATE
TMSG <
[Command file completed]> ;SAY SO
JRST REEN ;AND REENTER COMMAND LOOP
NOISE: HRROM T2,NOIBLK+.CMDAT ;SAVE AS DATA
MOVEI T2,NOIBLK ;POINT TO BLOCK
JRST COMMND ;AND GO DO COMND JSYS
CONFRM: MOVEI T2,[FLDDB. (.CMCFM)] ;GET CONFIRM FUNCTION
COMMND: MOVEI T1,CMDBLK ;ALWAYS USE THIS BLOCK
COMND ;PARSE THE FUNCTION
ERJMP LOSE ;ERROR, GO COMPLAIN
TXNE T1,CM%NOP ;DID IT PARSE?
JRST LOSE ;NO, COMPLAIN
RET ;YES, RETURN SUCCESSFULLY
SUBTTL THE DATA AREA
XLIST ;DUMP THE LITERALS
LIT
LIST
CMDBLK: 0,,NEWPAR ;ADDRESS OF REPARSE ROUTINE
.PRIIN,,.PRIOU ;INPUT,,OUTPUT JFNS
-1,,[ASCIZ/SWSERR>/] ;CONTROL-R POINTER
-1,,TXTBUF ;POINTER TO TEXT BUFFER
-1,,TXTBUF ;POINTER TO CURRENT POSITION
TXTLEN ;NUMBER OF CHARS IN BUFFER
0 ;NUMBER OF UNPARSED CHARACTERS
-1,,ATMBUF ;POINTER TO ATOM BUFFER
TXTLEN ;NUMBER OF CHARACTERS IN BUFFER
EXP JFNBLK ;POINTER TO GTJFN BLOCK
JFNBLK: GJ%OLD ;FLAGS,,GENERATION NUMBER
.PRIIN,,.PRIOU ;INPUT,,OUTPUT JFNS
BLOCK 20 ;NO DEFAULTS
NOIBLK: FLDDB. (.CMNOI) ;BLOCK FOR NOISE FUNCTION
LEVTAB: EXP CHNPC1 ;WHERE TO STORE PC FOR LEVEL ONE INTERRUPT
BLOCK 2 ;OTHER LEVELS UNUSED
CHNTAB: XWD 1,LSTINT ;VECTOR FOR INTERRUPT ON THIS CHANNEL
BLOCK ^D35 ;OTHER CHANNELS UNUSED
CHNPC1: BLOCK 1 ;INTERRUPT PC STORED HERE
SAVEL: BLOCK 1 ;P SAVED HERE FOR ADJUST ON ^E
JFNX: BLOCK 1 ;JFN ON EXEC TO PUSH TO
HANDLE: BLOCK 1 ;FORK HANDLE FOR INFERIOR EXEC
OLDPRM: BLOCK 1 ;STORAGE FOR OLD I/O DESIGNATORS DURING TAKE
TAKJFN: BLOCK 1 ;TAKE FILE JFN WHEN NONZERO
JFNTMP: BLOCK 1 ;SINGLE LEVEL "JFN STACK"
BUGJFN: BLOCK 1 ;JFN ON SYSTEM:BUGSTRINGS.TXT
SAVEP: BLOCK 1 ;STORAGE OF STACK
PDL: BLOCK PDLSIZ ;STACK ROOM
TXTBUF: BLOCK TXTLEN/5+1 ;BUFFER FOR COMMAND JSYS
ATMBUF: BLOCK TXTLEN/5+1 ;BUFFER FOR ATOM BUFFER
JFNSTR: BLOCK 100 ;STORAGE FOR INPUT FILENAME
IJFN: BLOCK 1 ;INPUT FILE JFN
OJFN: BLOCK 1 ;OUTPUT FILE JFN
PAGENO: BLOCK 1 ;PAGE NUMBER
LINENO: BLOCK 1 ;LINE NUMBER
BGNTIM: BLOCK 1 ;BEGIN TIME
ENDTIM: BLOCK 1 ;END TIME
LSTDAT: BLOCK 1 ;LAST DATE OUTPUT WORD
;ENTRY DATA
HDRADR: BLOCK 1 ;ADDRESS OF CURRENT HEADER WORD
HDRWRD: BLOCK 1 ;CURRENT HEADER WORD
HDRTIM: BLOCK 1 ;DATE-TIME
BUGNAM: BLOCK 2 ;ASCIZ BUG NAME
BUGDAT: BLOCK 1 ;DATE/TIME OF BUG
BUGJOB: BLOCK 1 ;FORK,,JOB
BUGPIS: BLOCK 1 ;CONI PI, WORD FOR PI LEVEL
BUGUSR: BLOCK 1 ;USER NUMBER
BUGPNM: BLOCK 1 ;PROGRAM NAME
BUGFLG: BLOCK 1 ;BUG TYPE FLAG
BUGMSG: BLOCK <MSGSIZ==^D80/5> ;SPACE FOR THE BUGSTRING
;STORAGE FOR PARTICULAR NAME TABLES
NAMTAB: BLOCK 200 ;BUG INCLUDE NAME TABLE, WORD 0
;HAS COUNT, TWO WORD ASCIZ ENTRIES
;TBLUK TABLE FOR SUMMARY STUFF
SUMTAB: BLOCK 1 ;ALLOCATE SPACE
BLOCK SUMSIZ ; FOR TABLE OF POINTERS INTO FREE SPACE
;BUFFER FOR READING BUGSTRINGS.TXT
BUGBUF: BLOCK 100 ;LINE BUFFER
;FREE POOL FOR STRING STORAGE
FREPTR: BLOCK 1 ;FREE POINTER
POOL: BLOCK 2000 ;SOME FREE SPACE
END <3,,EVEC>