Google
 

Trailing-Edge - PDP-10 Archives - bb-d868b-bm_tops20_v3a_2020_dist - 3a-sources/sysera.mac
There are 15 other files named sysera.mac in the archive. Click here to see a list.
;<BAKER.SYSERR>SYSERA.MAC.6, 28-Jul-78 13:38:07, Edit by BAKER
;<BAKER.SYSERR>SYSERA.MAC.5, 21-Jul-78 13:21:35, Edit by BAKER
;<BAKER.SYSERR>SYSERA.MAC.4, 20-Jul-78 17:19:56, Edit by BAKER
;<BAKER.SYSERR>SYSERA.MAC.3, 12-Jul-78 11:18:06, Edit by BAKER
;<BAKER.SYSERR>SYSERA.MAC.2, 11-Jul-78 09:55:24, Edit by DRUEKE
;FIX ENTRY SWITCH
;<SYSERR>SYSERA.MAC.1, 22-Jun-78 11:18:16, EDIT BY WOJCIK
;HERE WE BEGIN TRACKING EDITS



	TITLE	SYSERA -- SYSTEM ERROR FILE PROCESSOR -- MAINLINE CODE
	SUBTTL	VERSION 12(763)		K. COYE/ RLD/ PJB/ ES/ TJW





;COPYRIGHT (C) 1972,1975,1977,1978 BY
;DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
;TRANSFERED.
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.


	SEARCH	SYRUNV
	SEARCH	SYRLOW
;*;	SEARCH	SCNMAC
	.REQUIRE SYRLIB


	;EXTERNALS DEFINED HERE ARE IN SYRLIB.MAC, THE LIBRARY
	;OF COMMON ROUTINES FOR ALL PARTS OF THE SYSERR PACKAGE.

	EXTERNAL DAEVER,HEADRD,ABORT,CHRCHK,DATECK,FILERR,TOOBIG,MBCHAR
	EXTERNAL CNISUM,BADNAM,MASSVM,DEVCHK,ERRINT,SKIPIT,IDCHK
	EXTERNAL STRCHK,DETCHK,DMPENT,HDRLST,PAGXCD,DVCHAR,TMCHAR
	EXTERNAL SAYDAY,GETNBS,.OCTLE,.DECML,.ASCIE,.SIXBT
	EXTERNAL .HAFWD,.SPECL,.HTIME,.PPNWW,.ODECW,.UDATE,.TASCI,.PPNWT
	EXTERNAL .TDIRW,R5VSIX,MONVER,BADADD,TAB031,TYPAST,BLDPTR
	EXTERNAL ACLST,SAVE4P,RET4P,HWDUMP,TYPBCD,LSTEB,JFLOOP,CNIDCD
	EXTERNAL XORTAB,BITLST,.DVTAB,.MXBLK,.TRBLK,.SUBLK,.SECBK
	EXTERNAL WDCNT,COMPAR,SKPRTN,TYPNBS,TITLST,SKIPWD,ADVBFF
	EXTERNAL FIXBUF,STBUFF,INPWD,GOSUM,GETWD,FFPRNT,SLPRNT,CLPRNT
	EXTERNAL TBPRNT,CHROUT,TTYSIX,MDECHR,FIXNAM






	;INTERNALS DEFINED HERE ARE FOR USE BY SYRLIB
	INTERNAL KONMSK,KLEDMP,MINERB,DEVDSP,MASLTH,ALLTBL
	INTERNAL NAMLTH,TYPMES,LINE,ALLLTH,NAMTBL,DUMDAY
	INTERNAL DEVTYP,ERINDX,PCSTBL,PDLPNT,BITCHK,ERRLTH
	INTERNAL MASNAM,ERRTBL,SUMUPD,MASNA2,MASLT2,MDE000
	



	




	;DUMALL -- DUMMY MACRO LEVEL 3
	;SUBMACRO DUMXXX
	;ARGS
	;NONE USED TO HOUSE LEVEL 2 SUBMACRO DUMXXX
	;THOSE DEFINED HERE ARE THOSE FULLY PROCESSED BY
	;THIS SEGMENT. PART OF EDIT #120.
;********BE VERY CAREFULL NOT TO USE "UDATE" IN ANY ENTRY
;********PROCESSED BY SYSERA.   .CTXXX MACRO DEFINITION HAS BEEN
;********MODIFIED TO SUPPORT CODE 5 ENTRIES!!!!!!!!!

	DEFINE	DUMALL<
	DUM001
	DUM003
	DUM005
	DUM006
	DUM007
	DUM010
	DUM017
	DUM020
	DUM040
	DUM041
	DUM071
>



	.JBVER==137
	LOC	.JBVER

	BYTE	(3)VWHO(9)VSYSER(6)VMINOR(18)VEDIT
	SALL


	TWOSEG
	RELOC	400000






	;DUMMY ROUTINE TOMAKEPACK. COMPILE
MDE000:
MASNA2:
MASLT2==0
KLEDMP:	BLOCK 0		;GIVE IT SOME SPACE

	;SUBTAB -- SUBROUTINES TO OUTPUT ENTRY WORD IN DESIRED FORMAT
	;SETUP  P1=ADDRESS OF TEXT TO BE OUTPUT AS DESCRIPTOR
	;	FOR THIS DATA WORD.
	;	P2= WORD TO BE OUTPUT.
	;CALL	PUSHJ	P,SUBTAB(MODE)
	;
	;RETURN	CALL+1
	;DISPATCHES TO APPROPIATE ROUTINE INTERNALLY TO DO WORD CONVERSION AND OUTPUT
SUBTAB:	SINDEX	<OCTLE>
	SINDEX	<DECML>
	SINDEX	<ASCIE>
	SINDEX	<SIXBT>
	SINDEX	<HAFWD>
	SINDEX	<SPECL>
	SINDEX	<HTIME>
	SINDEX	<PPNWW>
	SINDEX	<UDATE>
	SINDEX	<TASCI>
	SINDEX	<PPNWT>
	;PROCSA -- STANDARD ENTRY PROCESSOR #1
	;CALL	JRST PROCSA
	;
	;RETURN	JRST ABORT	WHEN ENTRY IS PROCESSED OR ABORTED
	;OPERATION IS CONTROLLED BY ENTRY IN CONTROL TABLE
	;ROUTINE GETS AOB POINTER TO DESIRED WORD IN BUFFER
	;IF THERE IS ONE PRESENT
	;THEN DISPATCHES TO WORD PROCESSOR LEVEL
	;VIA PUSHJ	P,SUBTAB(MODE)
	;PASSES BUFFER WORD IN P2 TO WORD PROCESSOR

PROCSA:	TRNE	F,F.BRF		;/BRIEF ?  -  EDIT [724]
	 JRST	NEWCMD##	;YES! - DO IT THAT WAY
	SETZM	OFFSET		;CLAR WORD OFFSET COUNT
	MOVE	P1,(CTINDX)	;PICKUP FIRST WORD IN CONTROL TABL
	JUMPE	P1,ABORT	;ABORT WHEN END OF CTL TABL SEEN
	TLNE	P1,770000	;DO WE NEED TO GET AN AOB POINTER
	PUSHJ	P,GETAOB	;YES-WORD IS IN A RELOCATABL SUBTABLE IN ENTRY
	LDB	T2,[POINT ^D9,P1,14]	;**WATCHOUT**PICKUP WORD LOCATION IN ENTRY
	ADD	T2,OFFSET	;OFFSET CONTAINS AOB BLOCK STARTING LOCATION
	CAML	T2,ENTRWC	;[153]DONT TRY TO ACCESS WORDS OUTSIDE OF ENTRY
	AOJA	CTINDX,PROCSA	;GET NEXT WORD IN CTL TABLE
	CAILE	T2,WKSIZE	;MAKE SURE THE WORD ASKED FOR IS IN WORK BUFFER
	AOJA	CTINDX,PROCSA	;IGNORE AND GET NEXT WORD
	MOVE	P2,WKBUFF(T2)	;PICKUP DATA WORD IN WORK BUFF
	LDB	T3,[POINT 3,P1,17]	;****WATCHOUT**PICKUP WORD PROCESSES MODE
	CAIG	T3,SUBMAX	;***WATCHOUT***IS IT AND UNKNOWN MODE
	PUSHJ	P,SUBTAB(T3)	;ITS RECOGINIZED
	AOJA	CTINDX,PROCSA	;EITHER NOT KNOWN OR FALL HERE

GETAOB:	LDB	T2,[POINT 6,P1,5]	;PICKUP AOBJN POINTER ADDRESS IN ENTRY
					;AOB GIVEN IS WITH REF TO HEADER
	SKIPL	T2,WKBUFF(T2)	;PICKUP THE ACTUAL POINTER AND SKIP IF LEGAL
	JRST	AOBQIT		;AOBJN POINTER = 0 CLEAN UP PDL AND GO TO PROCSA
	SUB	T2,HEADWC	;CORRECT AOB POINTER FOR HEADER SIZE
	HRRZM	T2,OFFSET	;SAVE IT IN OFFSET
	MOVEM	T2,AOBPNT	;SAVE POINTER FOR SPECL ROUTINE USAGE
	POPJ	P,		;VAMOOSE



	;HERE WHEN AOBJN POINTER = POS IN LH
	;NORMALLY SHOULD NOT HAPPEN

AOBQIT:	POP	P,T2		;DUMMY POP TO FIX PDP
	AOJA	CTINDX,PROCSA	;BUMP CTINDX AND BACK TO START
	SUBTTL	DIALOG RELATED SUBROUTINES
	;HERE IS THE DUMMY PROCSB FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERB.HGH

PROCSB:	MOVE	T1,[SIXBIT/SYSERB/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSB
PROCSN:	MOVE	T1,[SIXBIT/SYSERN/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSB

	;HERE IS THE DUMMY PROCSD FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERD.HGH

PROCSD:	MOVE	T1,[SIXBIT/SYSERD/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSB


	;HERE IS THE DUMMY PROCSC FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERC.HGH

PROCSC:	MOVE	T1,[SIXBIT/SYSERC/]
	MOVEM	T1,OVRBLK+1	;INTO THE SPEC AREA
	SETZ	15,
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;TUCK AWAY OUR AC'S
	JRST	OVRLAY		;NOW PLEASE OVERLAY US WITH PROCSC



	;STARTA-- ROUTINE TO START AT WHEN OVERLAYED
	;TO CORRECTLY PROCESS CURRENT ENTRY.

STARTA:	MOVEI	T1,CHROUT	;OUR TYPEOUT ROUTINE
	PUSHJ	P,.TYOCH##	;INIT SCAN
	MOVE	T1,ERTYPE	;CURRENT TYPE
	PUSHJ	P,ERRINT	;GET OUR INDEX VALUE
	MOVE	T1,ERTYPE	;CORRECT INDEX TO ENTCHR TABLE
	MOVE	T2,ENTCHR(T1)	;PICKUP ENTRY CHAR WORD
	TLZ	F,F.BTCK	;CLEAR EXAMINE ENTRY FLAG
	TRNN	F,F.ENT		;/ENTRY ?  [752]
	TRNE	F,F.SEQ
	 JRST	START1
	TLNN	T2,E.LALL!E.LNXM!E.LPAR!E.LPER!E.LSUM	;ANY LISTING DESIRED
	JRST	SKIPIT		;SKIP THIS ENTRY
	TLNE	T2,E.LNXM!E.LPAR!E.LPER!E.LSUM	;ANY REASON TO DO BIT CHECKING?
	TLO	F,F.BTCK	;YES-SET FLAG TO DO IT LATER
START1:	MOVE	T3,ERTYPE	;GET CORRECT INDEX
	AOS	ENTCHR(T3)	;NO- BUMP COUNTER
	SETZ	WKINDX,		;CLEAR INDEX INTO BUFFER
	SKIPG	T1,ENTRWC	;PICKUP ENTRY LENGTH AND CHECK FOR LEGALITY
	FATAL	<ENTRY WITH ZERO LENGTH BODY SPECIFIED>
	MOVE	P4,ERRIND
	TLNE	F,F.BTCK	;ANY TO DO?
	PUSHJ	P,@BITCHK(P4)	;GO DO IT
	TRNE	F,F.REM		;[417]/REMOTE?
	 PUSHJ	P,REMDAT##	;YES-DO IMAGE BINARY DUMP
	PUSHJ	P,HDRLST
	MOVE	T2,ALLIND
	HRRZ	T1,PCSTBL(T2)
	HLRZ	CTINDX,PCSTBL(T2)	;CONTROL TABLE ADDRESS
	JRST	(T1)

	;SPECIAL DECODING ROUTINES

HARDER:	IFN	DEBUGA,<
	TYPEIT	<

UNIT HARD ERROR TOTALS>
	PUSHJ	P,DECHAF
>
	POPJ	P,
SOFTER:	IFN	DEBUGA,<
	TYPEIT	<

UNIT SOFT ERROR TOTALS>
	PUSHJ	P,DECHAF
>
	POPJ	P,
SOFDET:	IFN	DEBUGA,<
	TYPEIT	<

UNIT SOFTWARE-DETECTED ERROR TOTALS>
	TYPEIT	<
	SAT DISCREPANCIES:	>
	LDB	T1,[POINT 12,P2,11]	;PICKUP SAT ERROR BYTE
	PUSHJ	P,.ODECW
	TYPEIT	<
	RETRIEVAL INFO ERRORS:	>
	LDB	T1,[POINT 12,P2,23]	;PICKUP # RIB ERRORS
	PUSHJ	P,.ODECW
	TYPEIT	<
	CHECKSUM ERRORS:	>
	LDB	T1,[POINT 12,P2,35]	;PICKUP # CHKSUM ERRORS
	PUSHJ	P,.ODECW
>
	POPJ	P,		;GO AWAY
SEKINC:	IFN	DEBUGA,<
	TYPEIT	<
	SEEK INCOMPLETES:	>
	MOVE	T1,P2
	PUSHJ	P,.ODECW
>
	POPJ	P,

SOFHNG:	IFN	DEBUGA,<
	TYPEIT	<
	HARD XFER HANGS:	>
	MOVE	P3,[POINT 9,P2]
	ILDB	T1,P3		;PICKUP BITS 0-8
	PUSHJ	P,.ODECW
	TYPEIT	<
	SOFT XFER HANGS:	>
	ILDB	T1,P3		;PICKUP BITS 9-17
	PUSHJ	P,.ODECW
	TYPEIT	<
	SOFT SEEK HANGS:	>
	ILDB	T1,P3		;PICKUP BITS 18-27
	PUSHJ	P,.ODECW
	TYPEIT	<
	SOFT SOFTWARE HANGS:	>
	ILDB	T1,P3
	PUSHJ	P,.ODECW
>
	POPJ	P,

RETRYS:	TYPEIT	<
	RETRIES	PERFORMED:	>
	IFN	DEBUGA,<
	TLNE	P2,ERRHRD	;WAS THIS ERROR NON-RECOVERABLE?
	PUSHJ	P,TYPAST	;YES TYPE ASTERISK
>
	TLZ	P2,-1		;CLEAR LH OF P2
	MOVE	T1,P2
	PUSHJ	P,.ODECW
	POPJ	P,		;GO AWAY


	IFN	DEBUGA<
	;ROUTINE TO DECODE LH AND RH OF WORD AND PUBLISH IT
	;USED WITH UNIHCT AND UNISCT

DECHAF:	TYPEIT	<
	DATA PARITY:		>
	HRRZ	T1,P2		;PICKUP LH COUNT
	PUSHJ	P,.ODECW
	TYPEIT	<
	DEVICE OR POSITION:	>
	HLRZ	T1,P2		;PICKUP RH COUNT
	PUSHJ	P,.ODECW
	POPJ	P,		;GO BACK
>

	;DISKPR -- SUBROUTINE TO PUBLISH READ,WRITE AND SEEK STATISTICS
	;CALLED FROM PROCSA WITH PUSHJ	P,DISKPR
	;
	;RETURN	CALL+1

DISKPR:	IFN	DEBUGA,<
	TYPEIT	<

DISK PERFORMANCE TOTALS:
	READS:			>
	MOVE	T1,P2
	PUSHJ	P,.ODECW
	TYPEIT	<
	WRITES:			>
	MOVE	T1,WKBUFF+HDETWC	;PICKUP TOTAL # READS SINCE RELOAD
	PUSHJ	P,.ODECW	;PUBLISH IT
	TYPEIT	<
	SEEKS:			>
	MOVE	T1,WKBUFF+HDETSC	;PICKUP TOTAL # SEEKS SINCE RELOAD
	PUSHJ	P,.ODECW
>
	POPJ	P,

;HERE START THE ROUTINES TO LIST THE EXTRACTED CRASH INFORMATION,
;CODE 5 ENTRIES.

UNKN:	252525,252525		;[527]
CINLST:	PUSHJ	P,DEVLST		;GO LIST UNIT STATS
	PUSH	P,P1		;SAVE
	SETZ	P1,
	PUSHJ	P,DETCHK##		;/DET?
	POP	P,P1
	TYPEIT	<
CONTENTS OF GETTAB'D ITEMS:
>
	SETZB	P1,P2		;SOME STORAGE
	MOVEI	P3,3		;3 ITEMS PER LINE
CINCON:	MOVE	P2,CINTAB(P1)	;GET NEXT ITEM
	SKIPN	P2		;IF ZERO
	 PJRST	CINCUS		;GO CHECK FOR CUSTOMER ADDED ITEMS
	LDB	T1,[POINT 6,P2,14]	;GET SUBTAB OFFSET
	HRLZ	P4,T1
	LDB	T2,[POINT 3,P2,17]	;AND FLAG BITS
	HRR	P4,T2
	PUSHJ	P,SAVE4P##	;HOLD P1-P4
	HRRZ	P1,P2		;ADDR OF TEXT
	LDB	T1,[POINT 9,P2,8]	;GET OFFSET IN WKBUFF TO DATA WORD
	MOVE	P2,WKBUFF(T1)	;DATA ITEM TO P2
	CAMN	P2,UNKN		;[527]
	 JRST	BADVAL	
	HLRZ	T1,P4		;OFFSET TO SUBTAB
	CAIN	T1,5		;SUBTAB OFFSET =SPECIAL?
	 JRST	SPEC(T2)	;GO HANDLE SPECIAL ITEMS
	PUSHJ	P,SUBTAB(T1)	;GO LIST ITEM AND TEXT
CINCN1:	PUSHJ	P,RET4P##	;RESTORE P1-P4
	SOSG	,P3		;DONE 3 FOR THIS LINE?
	 PUSHJ	P,[ PUSHJ P,.TCRLF
		    MOVEI P3,3
		    POPJ  P,0]	;YES
	CAIE	P3,3		;NO TAB FOR 1ST ITEM EACH LINE
	PUSHJ	P,.TTABC	;SPACE OVER
	AOJA	P1,CINCON	;GET NEXT ITEM ON LIST
	;[527]
BADVAL:	HRRZ	T1,P1	;ADDR OF ASCIZ
	PUSHJ	P,.TSTRG
	TYPEIT	< UNKNOWN>
	JRST	CINCN1
	

SPEC:	JRST  SPEC0
	JRST  SPEC1
	JRST  SPEC2
	JRST SPEC3
	JRST SPEC4
	JRST SPEC5
	JRST SPEC6
	JRST SPEC7

SPEC0:	IMULI	P2,^D24*^D3600
	MOVEM	P2,DATLOC	;SAVE #OF TICKS PER SECOND
	JRST	SPECX		;AND USE COMMON EXIT

SPEC1:	MOVE	T1,P1		;ADDR OF TEXT
	PUSHJ	P,.TSTRG	;IN ASCIZ
	MOVE	T1,P2
	SETZ	T2,
	ASHC	T1,-^D17
	DIV	T1,DATLOC
	MOVE	T2,T1
	HLR	T1,T2
	CAIE	T1,0
	PUSHJ	P,SAYDAY##
	HRRZ	T1,T2
	HRL	T1,DUMDAY
	PUSHJ	P,.CNTDT
	PUSHJ	P,.TTIME
	JRST	SPECX		;COMMON EXIT

SPEC2:	TYPEIT	<

PARITY ERROR INFORMATION:
>
	JRST	SPECX		;COMMON EXIT
SPEC3:	TYPEIT	<

SYSTEM RESPONSE INFORMATION:
>
	JRST	SPECX		;COMMON EXIT

SPEC4:	PUSHJ	P,.TCRLF	;START ON NEXT LINE
	PUSHJ	P,.TCRLF	;WITH A BLANK LINE
	MOVEI	P3,3		;RE-INIT THE ITEM COUNTER
	JRST	SPECX		;COMMON EXIT
SPEC5:
SPEC6:
SPEC7:

SPECX:	PUSHJ	P,RET4P		;RESTORE P1-P4
	AOJA	P1,CINCON	;DUMMY FOR NOW

;HERE CHECK FOR GETTABED ITEMS DEFINED BY CUSTOMER
;ANY FOUND WILL BE LISTED IN OCTAL

CINCUS:	MOVE	T1,WKBUFF+CINUNI	;GET # OF DISK UNITS INCLUDED
	IMULI	T1,10			;10 ITEMS PER UNIT
	ADDI	T1,1			;ADJUST PNTR
	MOVE	P1,WKBUFF+CINUNI(T1)	; BETTER BE AOBJN PNTR OF LENGTH OF ITEMS
	SKIPN	P1			;IF ZERO,
	 PJRST	TITLST			;WE'RE DONE
	TYPEIT	<
LISTING CUSTOMER DEFINED GETTAB ITEMS IN OCTAL
	>
CUSCON:	MOVE	T1,WKBUFF(P1)	;GET AN ITEM
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	AOBJN	P1,CUSCON		;MORE TO DO
	PJRST	TITLST			;NOPE
;ROUTINE TO LIST THE DISK DATA BLOCKS FROM CRASH.EXE ENTRIES

DEVLST:	TYPEIT	<
DISK UNIT STATISTICS:
>
	MOVE	P2,WKBUFF+CINUNI	;GET COUNT OF UNITS TO DO
	MOVEI	P1,CINUNI+1		;OFFSET TO START OF FIRST
	TYPEIT	<
DEV	TYPE	READS	WRITES	SEEKS	SDEV	SDAT	HDEV	HDAT	SAT	RIB	CHK>
DEVLS1:	PUSHJ	P,.TCRLF		;START ON NEXT LINE
	MOVE	T1,WKBUFF(P1)	;GET UNIT NAME
	PUSHJ	P,.TSIXN		;IN SIXBIT
	PUSHJ	P,.TTABC
	MOVE	T1,WKBUFF+1(P1)		;DSKCHR VALUE
	PUSHJ	P,DEVDET		;DETERMINE AND LIST UNIT TYPE
	PUSHJ	P,.TTABC
	MOVE	T1,WKBUFF+2(P1)	;# READS
	PUSHJ	P,.ODECW	;WITH A "."
	PUSHJ	P,.TTABC
	MOVE	T1,WKBUFF+3(P1)	;# WRITES
	PUSHJ	P,.ODECW	;WITH A "."
	PUSHJ	P,.TTABC
	MOVE	T1,WKBUFF+4(P1)	;# SEEKS
	PUSHJ	P,.ODECW	;WITH A "."
	PUSHJ	P,.TTABC
	HLRZ	T1,WKBUFF+5(P1)	;# SOFT DEVICE ERRORS
	PUSHJ	P,.ODECW	;WITH A "."
	PUSHJ	P,.TTABC
	HRRZ	T1,WKBUFF+5(P1)	;# SOFT DATA ERRORS
	PUSHJ	P,.ODECW	;WITH A "."
	PUSHJ	P,.TTABC
	HLRZ	T1,WKBUFF+6(P1)	;# HARD DEVICE ERRORS
	PUSHJ	P,.ODECW	;WITH A "."
	PUSHJ	P,.TTABC
	HRRZ	T1,WKBUFF+6(P1)	;# HARD DATA ERRORS
	PUSHJ	P,.ODECW	;WITH A "."
	PUSHJ	P,.TTABC
	LDB	T1,[POINT 12,WKBUFF+7(P1),11]	;SAT
	PUSHJ	P,.ODECW
	PUSHJ	P,.TTABC
	LDB	T1,[POINT 12,WKBUFF+7(P1),23]	;RIB
	PUSHJ	P,.ODECW
	PUSHJ	P,.TTABC
	LDB	T1,[POINT 12,WKBUFF+7(P1),35]	;CHK
	PUSHJ	P,.ODECW
	PUSHJ	P,.TTABC
	SUBI	P2,1		;DONE A UNIT
	ADDI	P1,10		;BUMP OFFSET BY A UNIT'S WORTH
	SKIPN	P2		;IF ZERO,
	 POPJ	P,0		;WE'RE DONE
	JRST	DEVLS1		;ELSE DO ANOTHER
;ROUTINE TO DETERMINE AND LIST THE UNIT TYPE DESCRIPTION FOR THE
;DSKCHR VALUE IN T1

DEVDET:	LDB	T2,[POINT 6,T1,26]	;T2 GET CONTROLLER CODE
	LDB	T3,[POINT 3,T1,32]	;T3 GET UNIT CODE
	LSH	T2,3			;SHIFT LEFT 3 BIT
	IOR	T2,T3			;T2 GETS A PNTR
	MOVE	T1,[SIXBIT/UNKN/]	;SAY UNKNOWN
	CAIN	T2,10
	 MOVE	T1,[SIXBIT/RD10/]
	CAIN	T2,11
	 MOVE	T1,[SIXBIT/RM10B/]
	CAIN	T2,21
	 MOVE	T1,[SIXBIT/RP02/]
	CAIN	T2,22
	 MOVE	T1,[SIXBIT/RP03/]
	CAIN	T2,40
	 MOVE	T1,[SIXBIT/RS04/]
	CAIN	T2,50
	 MOVE	T1,[SIXBIT/RP04/]
	CAIN	T2,51
	 MOVE	T1,[SIXBIT/RP06/]
	SKIPN	T1			;A TYPE DETERMINED YET??
	 MOVE	T1,[SIXBIT/UNKN/]	;WE MUST SAY SOMETHING
	PUSHJ	P,.TSIXN
	POPJ	P,0			;RETURN TO CALLER
;THIS IS THE TABLE OF GETTAB ITEMS TO BE EXTRACTED FROM A CRASH.
;ADDITIONAL ITEMS SHOULD NOT BE ADDED HERE BY A SITE BECAUSE IT WILL
;CONFUSE SYSERR VERY BADLY. USE THE TABLE CRSGT1 INSTEAD.
;  ";***" INDICATES A SUBTABLE ITEM
	RADIX 10
;THE CIN MACRO HAS THE FOLLOWING SUBARGUEMENTS
;A - THE OFFSET NAME AS DEFINED IN SYRUNV
;B - THE OFFSET VALUE
;C - THE PRINT CODE AS AN OFFSET TO SUBTAB
;D - SOME TYPE OF A FLAG VALUE SUCH AS DONT LIST THIS ITEM
;E - THE TEXT TO LIST FOR THIS VALUE

	DEFINE CINALL<
	CIN	(CINTIC,7,5,0,<              #TICKS PER SECOND: >)
	CIN	(CINTIM,3,5,1,<                    TIME OF DAY: >)
	CIN	(CINSIZ,4,0,0,<             SYSTEM MEMORY SIZE: >)
	CIN	(CINPOK,5,0,0,<                LAST ADDR POKED: >)
	CIN	(CINLNM,6,1,0,<               # JOBS LOGGED IN: >)
	CIN	(CINDBG,9,4,0,<              DEBUG STATUS WORD: >)
	CIN	(CINHSO,10,0,0,<      START OF MONITOR HIGH SEG: >)
	CIN	(CINNWC,11,0,0,<              #OF WORDS OF CORE: >)
	CIN	(CINUPT,12,1,0,<                UPTIME IN TICKS: >)
	CIN	(CINEPO,20,1,0,<            # UNREC EXEC PDL OV: >)
	CIN	(CINEPP,21,1,0,<        # RECOVERED EXEC PDL OV: >)
	CIN	(CINERC,22,1,0,<               SWAP ERROR COUNT: >)
	CIN	(CINDEL,23,1,0,<  DISABLED HARDWARE ERROR COUNT: >)
	CIN	(CINSPC,24,3,0,<                    LAST STOPCD: >)
	CIN	(CINNDS,25,1,0,<                # DEBUG STOPCDS: >)
	CIN	(CINNJS,26,1,0,<                  # JOB STOPCDS: >)
	CIN	(CINSJN,27,0,0,<         LAST STOPCD-JOB NUMBER: >)
	CIN	(CINSPN,28,3,0,<       LAST STOPCD-PROGRAM NAME: >)
	CIN	(CINSUU,29,4,0,<                LAST STOPCD-UUO: >)
	CIN	(CINSPP,30,7,0,<               LAST STOPCD-P,PN: >)
	CIN	(CINPAR,31,5,2,<                PARITY SUBTABLE: >)
	CIN	(CINTPE,14,1,0,<           TOTAL MEM PAR ERRORS: >)
	CIN	(CINSPE,15,1,0,<   TOTAL SPURIOUS PARITY ERRORS: >)
	CIN	(CINMPC,16,1,0,<         MULTIPLE PARITY ERRORS: >)
	CIN	(CINMPA,17,0,0,<               LAST PARITY ADDR: >)
	CIN	(CINMPW,18,4,0,<               LAST PARITY WORD: >)
	CIN	(CINMPP,19,0,0,<                 LAST PARITY PC: >)
	CIN	(CINPLA,32,0,0,<   HIGHEST ADDR OF PARITY ERROR: >)
	CIN	(CINPMR,33,0,0,<  ADDRESS IN SEGMENT OF PAR ERR: >)
	CIN	(CINPTS,34,1,0,<        # PAR ERRORS THIS SWEEP: >)
	CIN	(CINPSC,35,1,0,<                       # SWEEPS: >)
	CIN	(CINPUE,36,1,0,<            USER ENABLED ERRORS: >)
	CIN	(CINPAA,37,4,0,<           LOGICAL AND  OF ADDR: >)
	CIN	(CINPAC,38,4,0,<            LOGICAL AND OF DATA: >)
	CIN	(CINPOA,39,4,0,<             LOGICAL OR OF ADDR: >)
	CIN	(CINPOC,40,4,0,<             LOGICAL OR OF DATA: >)
	CIN	(CINPCS,41,1,0,<   COUNT OF SPUR CHANNEL ERRORS: >)
	CIN	(CINRSP,42,5,3,<              RESPONSE SUBTABLE: >)
	CIN	(CINRSO,43,1,0,<            SUM TTY OUT UUO RES: >)
	CIN	(CINRNO,44,1,0,<                NUM TTY OUT UUO: >)
	CIN	(CINRHO,45,1,0,<          HI-SUM SQ TTY OUT UUO: >)
	CIN	(CINRLO,46,1,0,<          LO-SUM SQ TTY OUT UUO: >)
	CIN	(CINRSI,47,1,0,<                SUM TTY INP UUO: >)
	CIN	(CINRNI,48,1,0,<             NUMBER TTY INP UUO: >)
	CIN	(CINRHI,49,1,0,<          HI-SUM SQ TTY INP UUO: >)
	CIN	(CINRLI,50,1,0,<          LO-SUM SQ TTY INP UUO: >)
	CIN	(CINRSR,51,1,0,<            SUM QUANTUM REQ RES: >)
	CIN	(CINRNR,52,1,0,<         NUMBER QUANTUM REQ RES: >)
	CIN	(CINRHR,53,1,0,<          HI-SUM SQ QUANTUM RES: >)
	CIN	(CINRLR,54,1,0,<      LO-SUM SQ QUANTUM REQ RES: >)
	CIN	(CINRSX,55,1,0,<               SUM ONE OF ABOVE: >)
	CIN	(CINRNX,56,1,0,<            NUMBER ONE OF ABOVE: >)
	CIN	(CINRHX,57,1,0,<         HI-SUM SQ ONE OF ABOVE: >)
	CIN	(CINRLX,58,1,0,<         LO-SUM SQ ONE OF ABOVE: >)
	CIN	(CINRSC,59,1,0,<                    SUM CPU RES: >)
	CIN	(CINRNC,60,1,0,<                 NUMBER CPU RES: >)
	CIN	(CINRHC,61,1,0,<                 HI-SUM CPU RES: >)
	CIN	(CINRLC,62,1,0,<                 LO-SUM CPU RES: >)
	CIN	(CINUPT,0,5,4,<DUMMY TO GET CRLF>)
	CIN	(CINUPT,63,5,1,<                         UPTIME: >)
	CIN	(CINLST,64,5,1,<                      LOST TIME: >)
	CIN	(CINNUL,65,5,1,<                      NULL TIME: >)
	CIN	(CINOHT,66,5,1,<                  OVERHEAD TIME: >)
	CIN	(CINTUC,67,1,0,<                TOTAL UUO COUNT: >)
	CIN	(CINTJC,68,1,0,< TOTAL JOB CONTEXT SWITCH COUNT: >)
	CIN	(CINTNE,69,1,0,<                      TOTAL NXM: >)
	CIN	(CINSNE,70,1,0,<                 TOTAL SPUR NXM: >)
	CIN	(CINNJA,71,1,0,<       # JOBS AFFECTED LAST NXM: >)
	CIN	(CINMNA,72,0,0,<            FIRST ADDR LAST NXM: >)
	>;END OF CINALL DEFINITION
;LAST VALUE IS CINUNI , A
;COUNT OF DISK INFO BLOCKS IN THIS ENTRY,
	;EACH HAS THE FORMAT
	;SIXBIT NAME
	;DSKCHR UUO RESULTS
	;TOTAL # READS
	;TOTAL # WRITES
	;TOTAL # SEEKS
	;# SOFT ERRORS
	;# HARD ERRORS
	;# MONITOR DETECTED ERRORS (RIB,ETC)
	RADIX 8

;NOW DEFINE SOMETHING TO DO WITH THE CIN MACRO AND THEN CALL IT
;VIA CINALL

	DEFINE CIN(A,B,C,D,E)<
	BYTE (^D9)B(6)C(3)D(^D18)<[ASCIZ/E/]>
	>
	RADIX 10
CINTAB:	CINALL
	0
	RADIX 8
	;MEMLST--ROUTINE TO SET UP AND CALL ROUTINE TO LIST
	;MEMORY CONFIG AT RELOAD. P2 HAS WHYKPG
MEMLST:	HLRZ	T1,P2		;UNLIKELY CODE
	CAIE	T1,707070	;GOOD?
	 POPJ	P,0		;OLD STYLE ENTRY
	SETOM	KFLAG		;ASSUME K PER BIT
	TRNE	P2,1B35		;1= USE PAGES
	 SETZM	KFLAG		;CHANGE IT
	MOVE	P1,WKBUFF+WHYBIT	;POINTER
	PUSHJ	P,BLDPTR	;CORRECT IT
	PUSH	P,P1		;SAVE IT
	SETCMM	0(P1)		;COMPLEMENT THE WHOLE TABLE
	AOBJN	P1,.-1		;UNTIL FINISHED
	TYPEIT	<
MEMORY ON-LINE AT RELOAD:
>
	POP	P,P2		;RETURN A GOOD POINTER
	PUSHJ	P,BITLST	;GO DO TRANSLATION
	POPJ	P,0		;BACK TO PROCSA


DEBLST:	TYPEIT	<
	OCTAL VALUE	SIXBIT VALUE>
	ADDI	P2,WKBUFF	;A BETTER POINTER
	
DEBLSA:	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	MOVE	P1,0(P2)	;GET A WORD
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TTABC
	MOVE	T1,P1	;SAME WORD AGAIN
	PUSHJ	P,.TSIXN
	AOBJN	P2,DEBLSA	;MORE TO DO?
	POPJ	P,0	;NOPE

	;HERE FOR CODE 71 ENTRIES P2 HOLDS LPTTYP

LPTLST:	TYPEIT	<
	CONTROLLER TYPE:	>
	LDB	T2,[POINT 6,P2,5]	;GET CONTROLLER TYPE-T2
	MOVE	T1,[SIXBIT/LP100/]	;ASSUME LP100
	CAIE	T2,2			;IS IT?
	 MOVE	T1,[SIXBIT/ BA10/]	;MUST BE BA10 OR ELSE...
	PUSHJ	P,.TSIXN		;LIST THE TYPE
	PUSHJ	P,.TCRLF
	TYPEIT	<	LAST DATA WORD SENT:	>
	MOVE	T1,WKBUFF+LPTWRD	;GET THAT WORD
	PUSHJ	P,.TXWDW		;IN HALF WORD
	PUSHJ	P,.TCRLF
	TYPEIT	<	CONI AT ERROR:	>
	MOVE	T1,WKBUFF+LPTCNI	;GET THE CONI
	PUSH	P,T1			;SAVE IT
	PUSHJ	P,.TXWDW		;HALF WORD
	POP	P,P4			;CONI VALUE BACK
	TLNN	P2,(1B4)		;IS CONTROLLER LP100?
	 POPJ	P,0			;NO DON'T XLATE CONI
	PUSH	P,P4			;SAVE CONI
	TYPEIT	< = >
	MOVE	P1,P4			;VALUE TO TRANSLATE
	MOVEI	T1,5			;OFFSET TO BIT TABLES
	MOVEM	T1,KONTYP		;SETUP
	PUSHJ	P,CNIDCD		;DO TRANSLATION
;NOW DO BYTE TRANSLATION SUCH AS CHARACTER SET ETC.

	POP	P,P4			;VALUE BACK TO P4
	TYPEIT	<
	VFU TYPE:	>
	LDB	T2,[POINT 2,P4,1]	;GET TYPE FIELD
	MOVEI	T1,[ASCIZ/OPTICAL/]	;ASSUME 0
	CAIN	T2,1			;IF 1
	 MOVEI	T1,[ASCIZ/DIRECT ACCESS/]
	CAIN	T2,2			;IF 2
	 MOVEI	T1,[ASCIZ/NONE/]
	PUSHJ	P,.TSTRG		;SAY WHAT'S IN T1
	TYPEIT	<
	CHARACTER SET:	>
	LDB	T2,[POINT 3,P4,25]	;GET CHAR SET FIELD
	MOVEI	T1,[ASCIZ/64 CHAR/]	;ASSUME 0
	CAIN	T2,1			;IF 1
	 MOVEI	T1,[ASCIZ/96 CHAR/]
	CAIN	T2,2
	 MOVEI	T1,[ASCIZ/128 CHAR/]
	CAIN	T2,3
	 MOVEI	T1,[ASCIZ/VARIABLE/]
	PUSHJ	P,.TSTRG		;AGAIN,LIST SOMETHING
	TYPEIT	<
	PAGE COUNTER:	>
	LDB	T1,[POINT ^D12,P4,17]	;CONTENTS OF PAGE COUNTER
	PUSHJ	P,.ODECW		;IN DECIMAL WITH A "."
	POPJ	P,0			;THAT'S ALL THERE IS TO LIST
	;TMEA -- ROUTINE TO LIST ERROR CODE 20 ENTRIES.

	FUNMSK==17000	;LOCATION OF FUNCTION MASK IN CONI TMC.
	FUNSFT==11	;HOW FAR TO SHIFT IT.
	DENMSK==300	;MASK FOR DENSITY BITS.
	DENSFT==6	; SHIFTER.
	CORDMP==20000	; CORE DUMP BIT.
	PARTYP==40000	; PARITY BIT.
	STRK==4		;7 TRACK BIT.
	WLOCK==10	;WRITE LOCK BIT.

TMEA:	TYPEIT	<
	OPERATION:	   >
	MOVE	T4,WKBUFF+MAGICC	;GET INITIAL CONI TMC.
	MOVE 	T3,T4			;SAVE IT.
	ANDI	T3,FUNMSK		;STRIP OFF FUNCTION BITS.
	LSH	T3,-FUNSFT		;MOVE IT OVER.
	MOVEI	T1,@FUNMSG(T3)		;GET ADDRESS OF TEXT CORRESPON-
					;DING TO FUNCTION.
	PUSHJ	P,.TSTRG		;TYPE IT OUT.
	TYPEIT	<
	STATUS:            >
	MOVE	T3,WKBUFF+MAGICC	;GET CONI TMC AGAIN.
	ANDI	T3,DENMSK		;STRIP OFF DENSITY BITS.
	LSH	T3,-DENSFT		;MOVE IT OVER.
	MOVEI	T1,@DENMSG(T3)		;GET ADDRESS OF DENSITY MESSAGE.
	PUSHJ	P,.TSTRG		;PRINT IT.
	MOVE	T3,WKBUFF+MAGICC	;GET THAT WORD AGAIN.
	TRNN	T3,PARTYP		;ODD PARITY?
	JRST	TME.1			;NO, SAY EVEN PARITY.
	TYPEIT	<  ODD PARITY,>
	JRST	TME.2			;GO AROUND EVEN PARITY MSG.
TME.1:	TYPEIT	< EVEN PARITY,>
TME.2:	TRNN	T3,CORDMP		;CORE DUMP = 1?
	JRST	TME.3			;NO, DON'T SAY ANYTHING.
	TYPEIT	< CORE DUMP,>
TME.3:	MOVE	T3,WKBUFF+MAGICS	; CONI TMS.
	TRNN	T3,STRK			;7 OR 9?
	JRST	TME.4			;9.
	TYPEIT	< 7 TRACK,>
	JRST	TME.5			;GO AROUND 9.
TME.4:	TYPEIT	< 9 TRACK,>
TME.5:	MOVE	T3,WKBUFF+MAGICS	;GET IT AGAIN.
	TRNN	T3,WLOCK		;WRITE LOCKED?
	JRST	TME.6			;NO
	TYPEIT	< WRITE LOCKED
>
	JRST	TME.7
TME.6:	TYPEIT	< WRITE ENABLED
>
TME.7:	TYPEIT	<
ERROR DIAGNOSIS   >
	MOVE	P1,WKBUFF+MAGICS	;GET CONI TMS AGAIN.
	MOVE	T1,KONTYP		;GET CONTROLLER TYPE
	MOVE	T2,KONMSK(T1)		;GET MASK FOR THIS CONI.
	TDNN	P1,T2			;ANY ERROR BITS?
	JRST	TME.10			;NO.
	MOVE	T1,WKBUFF+MAGRTC	;GET # OF RETRIES.
	TLNN	T1,ERRHRD		;RECOVERABLE?
	JRST	TME.14			;NO.
	TYPEIT	<
	NON-RECOVERABLE >
	JRST	TME.15
TME.14:	TYPEIT	<
	RECOVERABLE >
TME.15:	PUSHJ	P,CNIDCD		;GO GET ERROR TRANSLATION.
	JRST	TME.11			;GO AROUND
TME.10:	TYPEIT	<	SOFTWARE ERROR!!>
TME.11:	TYPEIT	<

ERROR ANALYSIS:
	ERROR LOCATION:         RECORD >
	MOVE	T1,WKBUFF+MAGRFF	;GET # OF REC FROM EOF
	ADDI	T1,1			;THIS IS IN NEXT RECORD.
	PUSHJ	P,.ODECW		;TYPE IT.
	TYPEIT	( OF FILE )
	MOVE	T1,WKBUFF+MAGFFB	;GET # OF FILES FROM BOT.
	ADDI	T1,1			;AGAIN, NEXT FILE.
	PUSHJ	P,.ODECW		;TYPE THIS TOO.
	TYPEIT	<
	CONI TMS AT ERROR:      >
	MOVE	T1,WKBUFF+MAGICS	;GET THAT ONE AGAIN
	PUSHJ	P,.TXWDW		;TYPE IT IN HALF WORD.
	TYPEIT	< = >
	MOVE	P1,WKBUFF+MAGICS	;SETUP AND
	PUSHJ	P,CNIDCD		;CALL TRANSLATOR.
	TYPEIT	<
	CONI TMS AT END:        >
	MOVE	T1,WKBUFF+MAGFCS	;GET FINAL CONI TMS
	PUSHJ	P,.TXWDW		;TYPE IT ALSO
	MOVE	P1,WKBUFF+MAGFCS
	MOVE	T1,KONTYP		;GET CONTROLLER TYPE
	MOVE 	T2,KONMSK(T1)		;AND ERROR MASK.
	TYPEIT	< = >
	TDNN	P1,T2			;ANY ERRORS STILL AROUND?
	JRST	TME.12			;NO
	PUSHJ	P,CNIDCD		;TRANSLATE
	JRST	TME.13
TME.12:	TYPEIT	<  NO ERROR BITS DETECTED.>
TME.13:	TYPEIT	<
	RETRIES PERFORMED:      >
	HRRZ	T1,WKBUFF+MAGRTC	;GET # RETRYS WITHOUT ERRHRD BIT.
	PUSHJ	P,.ODECW		;LIST THIS TOO.
	TYPEIT	<
>					;ADD A LITTLE SPACE AND
	SKIPN	WKBUFF+MAGMED		;WAS THIS 10TH ERROR?
	POPJ	P,0			;NO
	MOVEI	T1,@FOO			;GET ADDRESS OF MESSAGE
	PUSHJ	P,.TSTRG		;AND OUTPUT IT.
	MOVEI	T1,@FOOA
	PUSHJ	P,.TSTRG
	MOVEI	T1,@FOOB
	PUSHJ	P,.TSTRG
	MOVEI	T1,@FOOC
	PUSHJ	P,.TSTRG
	POPJ	P,0			;GO HOME.

	;HERE ARE THE MESSAGES FOR THE FUNCTION DECODE
	;AND DENSITY MESSAGES.  INDEXED BY FUNCTION CODE.

FUNMSG:	[ASCIZ\	NO-OP\]

	[ASCIZ\	REWINDING\]
	[ASCIZ\	READ RECORD\]
	[ASCIZ\	READ-COMPARE RECORD\]	
	[ASCIZ\	WRITE\]
	[ASCIZ\	MARK END OF FILE\]
	[ASCIZ\ SPACE RECORDS FORWARD\]
	[ASCIZ\	SPACE RECORDS REVERSE\]
	[ASCIZ\ INTERRUPT WHEN UNIT READY\]
	[ASCIZ\	REWIND AND UNLOAD\]
	[ASCIZ\	READ MULTIRECORD\]
	[ASCIZ\	READ-COMPARE MULTIRECORD\]
	[ASCIZ\	ERASE AND WRITE\]
	[ASCIZ\	ERASE\]
	[ASCIZ\	SPACE FILE FORWARD\]
	[ASCIZ\	SPACE FILE REVERSE\]

DENMSG:	[ASCIZ\	200 BPI,\]
	[ASCIZ\	556 BPI,\]
	[ASCIZ\	800 BPI,\]
	[ASCIZ\	800 BPI,\]
	;ERDIAG -- SUBROUTINE TO DIAGNOSE POSSIBLE CAUSE OF ENTRY
	;CALL	PUSHJ	P,ERDIAG
	;
	;RETURN	CALL+1
ERDIAG:	TYPEIT	<
	DISK CHARACTERISTICS:	>
	MOVE	T1,P2		;PICKUP DSKCHR WORD
	PUSHJ	P,.TXWDW	;TYPE IT
	;CODE ADDED WITH EDIT 140 TO LIST USER'S ID ETC

	TYPEIT	<

	USER'S ID:	>
	MOVE	T1,WKBUFF+HDEUID	;GET P,PN
	PUSHJ	P,.TPPNW
	MOVEI	T1,[ASCIZ/
	USER'S PGM:	/]
	PUSHJ	P,.TSTRG
	MOVE	T1,WKBUFF+HDEPGM	;GET PROGRAM NAME
	PUSHJ	P,.TSIXN
	MOVEI	T1,[ASCIZ/
	USER'S FILE:	/]
	PUSHJ	P,.TSTRG
	MOVE	T1,WKBUFF+HDEFIL	;GET FILE REFERENCED
	HLRZ	T2,WKBUFF+HDEEXT	;GET EXTENSION
	CAIN	T2,'UFD'		;IF UFD DO SPECIAL FILE NAME
	 PUSHJ	P,[PUSHJ	P,.TPPNW
			AOS	0(P)
			POPJ	P,0]
	PUSHJ	P,.TSIXN
	TYPEIT	<.>
	HLLZ	T1,WKBUFF+HDEEXT	;EXTENSION IN LEFT HALF
	PUSHJ	P,.TSIXN
	;END EDIT 140
	TYPEIT	<

ERROR DIAGNOSIS
	>
	MOVE	P3,KONTYP	;PICKUP TYPE OF CONTROLLER 0=RC, 1=RP,4=RH10
	MOVE	P2,WKBUFF+HDESOF	;PICKUP 1CONI WORD
	MOVE	P4,KONMSK(P3)	;PICKUP CONTROLLER ERROR MASK
	TDNE	P4,P2		;ANY ERROR BITS LIT
	JRST	HARDCK		;YES-GO DO BIT DECODING
	TYPEIT	<SOFTWARE-DETECTED >
	MOVEI	P3,2		;SAY IT WAS A SOFTWARE DEVICE
	MOVEM	P3,KONTYP	;(EDIT 102)SET IT TO POINT AT SOFTWARE!!
	MOVE	P2,S		;PICKUP SOFTWARE STATUS FLAGS
	JRST	SAYIT		;PUBLISH TEXT

HARDCK:	AND	P2,P4		;APPLY MASK TO CONI WORD
	MOVE	T1,WKBUFF+HDEECT	;PICKUP RETRY WORD
	TLNN	T1,ERRHRD	;IF BIT 1 = 1 ERROR WAS NON-RECOVERABLE
	JRST	SOFTCK		;IT WAS RECOVERABLE
	TYPEIT	<NON-RECOVERABLE >
	JRST	SAYIT
SOFTCK:	TYPEIT	<RECOVERABLE >
SAYIT:	LSH	P2,@MINERB(P3)	;SHIFT WORD LEFT TILL FIRST KNOWN
					;ERROR BIT POSITION IS IN SIGN BIT
	MOVE	P4,DEVTYP(P3)	;PICKUP ASCIZ TEXT POINTER FOR ERROR BITS
	PUSHJ	P,JFLOOP		;EXIT TO TYPEOUT ENGLISH TRANSLATION
	;ADDED WITH EDIT 122
	LDB	P1,[POINT 9,WKBUFF+HDECCT,17]	;GET NUMBER OF SLOTS
	TYPEIT	<
	REMAINING ENTRIES IN
	UNIT'S BAT BLOCK:	>
	MOVE	T1,P1			;GET COUNT
	CAIN	T1,777			;=UNKNOWN?
	 JRST	SAYITA			;YES
	PUSHJ	P,.ODECW		;SAY IT IN DECIMAL
	PJRST	.TCRLF			;EXIT WITH SOME SPACE
SAYITA:	TYPEIT	<UNKNOWN>
	PJRST	.TCRLF
DEVTYP:	RC10DV
	RP10DV
	SOFTDV
	TM10DV
	RH10DV
	LPTDEV
	;CHNDCD -- SUBROUTINE TO ASSEMBLE ACTUAL COMMAND LIST
	;BASED ON TERMINATION WORD WRITTEN BY CHANNEL
	;CALL	PUSHJ P,CHNDCD
	;
	;RETURN	CALL+1

CHNDCD:	TYPEIT	<
	CHANNEL	COMMAND LIST:	>
	HLRZ	T1,WKBUFF+CPEFCW	;PICKUP TERMINATION CHANNEL WORD
	HRRZ	T2,WKBUFF+CPEICW	;PICKUP INITIAL CW
	CAMG	T1,T2		;IS TERM ADD GREATER THAN INIT CW ADDRESS
	JRST	ENTWD3		;NO ONLY WD3 IN LIST IS VALID
	CAIN	T1,1(T2)	;IS TERM ADD = INIT +1
	JRST	ENTWD2		;YES ONLY LIST WDS 2+3 OF CHAN CMD LIST
ENTWD1:	MOVE	T1,P2		;PICKUP 1ST WORD IN LIST
	PUSHJ	P,.TXWDW	;TYPE OUT IN HALFWORD FORMAT
	TYPEIT	<
				>
ENTWD2:	MOVE	T1,WKBUFF+CPECW1	;PICKUP CW #1
	PUSHJ	P,.TXWDW
	TYPEIT	<
				>
ENTWD3:	MOVE	T1,WKBUFF+CPECW0	;PICKUP WD3
	PUSHJ	P,.TXWDW
	POPJ	P,
	;CNXDCD -- ROUTINES TO DECODE CONI BITS IN CONI WORD
	;CALL	PUSHJ	P,CNXDCD
	;
	;RETURN	CALL+1

	;ENTRY FOR 1CONI WORD
CN1DCD:	TYPEIT	<
	CONI AT ERROR TIME:	>
	JRST	CONIGO

	;ENTRY FOR 2CONI WORD
CN2DCD:	TYPEIT	<
	CONI AFTER "RECAL":	>
CONIGO:	MOVE	T1,P2		;PICKUP CONI WORD
	PUSHJ	P,.TXWDW	;OUTPUT IT
	TYPEIT	<  =  >
	MOVE	T1,WKBUFF+HDEDCR	;PICKUP DSKCHR WORD
	MOVEI	P4,RP10DV	;ASSUME ITS A DISKPACK
	TRNE	T1,1B26		;IS IT A FIXED HEAD
	MOVEI	P4,RC10DV	;PICKUP CONI TABLE ADDRESS FOR RC10
	TRNE	T1,1B24		;IS IT A RH10?
	MOVEI	P4,RH10DV	;SAY SO
	MOVE	P3,KONTYP	;PICKUP CONTROLLER TYPE
	AND	P2,KONMSK(P3)
	LSH	P2,@MINERB(P3)
	PUSHJ	P,JFLOOP	;GO DECODE BITS AND OUTPUT TEXT
	TLNE	F,F.JFFO	;DID WE SEE ANY TEXT BIT
	POPJ	P,		;YES GO AWAY
	TYPEIT	<NO ERROR BITS DETECTED>
	POPJ	P,


	;BLKIND-- SUBROUTINE TO FIND ADDRESS OF A SCRATCH BLOCK
	;IN THE LOW SEG FOR THIS DEVICE WHICH IS SPECIFIED TO
	;THIS SUBROUTINE IN SIXBIT.
	;CALL P3=SIXBIT DEVICE NAME TO BE SEARCHED FOR
	;	PUSHJ	P,BLKIND
	;RETURNS CALL+1 IFERROR,NAME ISNT INTABLE ORIS DUPLICATED
	;	CALL+2 IF GOOD AND P3 =ADDRESS OF SCRATCH BLOCK

BLKIND:	TRNE	P3,7777	;EDIT132  FUNNY NAME?
	 PUSHJ	P,FIXNAM	;FIX IT
	MOVE	T1,[IOWD NAMLTH,NAMTBL];P3 ALREADYSETUP
	PUSHJ	P,.NAME		;LETSCANDO WORK
	  POPJ	P,		; LET CALLER HANDLE ERROR
	TLZ	T1,-1			;CLR LH
	SUBI	T1,NAMTBL	;T1 NOW = OFFSET
	MOVE	P3,BKLOC(T1)	;SETUP P3 TO RETURN
	AOS	(P)		;AND GIVESKIP
	POPJ	P,		;RETURN
	;LBNDCD -- SUBROUTINE TO CONVERT LOGICAL BLOCK NUMBERS TO PHYSICAL
	;DISK ADDRESSES.
	;SETUP	P2=LOGICAL BLOCK NUMBER OF ERROR
	;	HDEDCR=LOCATION OF DSKCHR WORD IN ENTRY
	;CALL	PUSHJ	P,LBNDCD
	;
	;RETURN	CALL+1

LBNDCD:	TYPEIT	<

ERROR ANALYSIS>
	SETZ	P1,		;P1 WILL HOLD DEVICE IDENTIFIER
	MOVEM	P2,.LBN		;STORE THE BLOCK # IN .LBN
	MOVE	P2,WKBUFF+HDEDCR	;GET THE DEVCHR WORDS
	TRNE	P2,1B26		;FIXED HEAD?
	JRST	.FHCHK		;YES-GO SEE IF IT'S A DRUM OR DISK
	TRNE	P2,1B25		;NO-IS IT A DISK PACK?
	JRST	.DPCHK		;YES-GO SEE IF IT IS AN RP02 OR RP03
	TRNE	P2,1B24		;RH10?
	JRST	.RHCHK		;YES
.DBOMB:	WARN	<UNDECIPHERABLE DISK CHARACTERISTIC WORD>
	TYPEIT	<
UNDECIPHERABLE DISK CHARACTERISTICS WORD
>
	PJRST	.LBPRT		;PRINT THE LOGICAL BLOCK NUMBER AND EXIT

.FHCHK:	TRNE	P2,1B32		;IS IT A BURROUGHS DISK?
	MOVEI	P1,1		;NO-SET CODE FOR BRYANT DRUM RM10B
	JRST	.BLKDV		;AND DIVIDE IN BLOCK NUMBERS

.DPCHK:	TRNE	P2,1B31		;IS IT AN RP02?
	JRST	.RP3CK		;NO-MAKE SURE IT'S AN RP03
	MOVEI	P1,2		;YES-SET CODE FOR RP02
	JRST	.BLKDV		;AND DIVIDE IN BLOCK NUMBERS

.RP3CK:	TRNE	P2,1B32		;IS IT IN FACT AN RP03?
	JRST	.DBOMB		;NO-WOULD YOU BELEIVE AN RP0X?
	MOVEI	P1,3		;YES-SET CODE FOR RP03
	JRST	.BLKDV
.RHCHK:	TRNE	P2,1B32		;RS04?
	JRST	.DBOMB		;NO - HELP!!
	MOVEI	P1,4		;YES SETUP P1.

.BLKDV:	PUSHJ	P,.DVPRT	;GO PRINT DEVICE TYPE
	PUSHJ	P,.LBPRT	;GO PRINT THE LOGICAL BLOCK NUMBER
	MOVE	P2,.LBN		;RETURN THE BLOCK NUMBER TO P2
	CAMGE	P2,.MXBLK(P1)	;[144]IS THIS BLOCK ON FIRST UNIT OF STR?
	JRST	.TCPRT		;YES-GO PRINT TRACK/CYLINDER ADDRESS
	SUB	P2,.MXBLK(P1)	;NO-SUBTRACT ONE UNIT'S WORTH OF BLOCKS
	JRST	.-3		;AND CHECK AGAIN

.TCPRT:	MOVEI	T1,[ASCIZ/
	CYLINDER:		/]
	CAIG	P1,1		;IS IT A DISK PACK?
	MOVEI	T1,[ASCIZ/
	TRACK:			/]
	CAIN	P1,4		;OR RS04?
	MOVEI	T1,[ASCIZ/
	TRACK:			/]
	PUSHJ	P,.TSTRG	;TYPE EITHER CYL OR TRK
	IDIV	P2,.TRBLK(P1)	;DIVIDE IT BY TRACKS PER UNIT
	MOVE	T1,P2		;STAND BY TO DUMP IT
	PUSHJ	P,.ODECW
	MOVE	P2,P3		;REMAINDER TO P2
	CAIG	P1,1		;IS IT A PACK?
	JRST	.SECPR		;NO-GO PRINT SECTOR ADDRESS
	CAIN	P1,4		;RS04?
	JRST	.SECPR		;YES.
	MOVEI	T1,[ASCIZ/
	SURFACE:		/]
	PUSHJ	P,.TSTRG
	IDIV	P2,.SUBLK(P1)	;DIVIDE BY # BLOCKS PER SURFACE
	MOVE	T1,P2
	PUSHJ	P,.ODECW
	MOVE	P2,P3		;SAVE REMAINDER

.SECPR:	MOVEI	T1,[ASCIZ/
	SECTOR:			/]
	PUSHJ	P,.TSTRG
	IMUL	P2,.SECBK(P1)	;MULTIPLY IT BY SECTORS PER BLOCK
	MOVE	T1,P2
	PUSHJ	P,.ODECW
	POPJ	P,		;EXEUNT

.LBPRT:	MOVEI	T1,[ASCIZ/
	LOGICAL	BLOCK NUMBER:	/]
	PUSHJ	P,.TSTRG
	MOVE	T1,.LBN
	PUSHJ	P,.ODECW
	POPJ	P,

.DVPRT:	TYPEIT	<
	DEVICE	TYPE:		>
	MOVEI	T1,.DVTAB(P1)	;PICKUP ADDRESS OF ASCIZ DEVICE
	PUSHJ	P,.TSTRG	;TELL THE WORLD
	POPJ	P,		;RETURN
	SUBTTL	OUTPUT LISTING RELATED ROUTINES
	;BCKXXX -- SUBROUTINES TO DETERMINE LISTING AND SUMMATION ELIGIBILITY
	;BASED ON BITS IN ENTCHR TABLE
	;CALL	PUSHJ	P,@BITCHK(ERROR CODE)
	;
	;RETURN	CALL+1 TO LIST
	;	JRST	ABORT TO GO TO NEXT ENTRY

BCK1:	MOVE	P1,RELTIM
	JUMPE	P1,FSTPAS
	MOVE	P1,HDBUFF+HDRDAT
	SUB	P1,HDBUFF+HDRUPT
	SUB	P1,RELTIM
	CAIGE	P1,200		;ABOUT 1 MINUTE
	JRST	ABORT		;THIS IS DEAMON RESTART,FORGET IT.
FSPCON:	MOVE	P1,ERTYPE	;PICKUP ENTRY TYPE
	MOVE	P2,ENTCHR(P1)	;PICKUP CHAR WORD
	TLNE	P2,E.LSUM	;DO WE WANT SUMMARY
	PUSHJ	P,SUM1
	TLNN	P2,E.LNXM	;NXM CAUSED RELOAD
	JRST	B1.1
	MOVE	T1,[SIXBIT/NXM/]
	CAMN	T1,WKBUFF+WHYWHY	;CAUSED BY NXM?
	POPJ	P,		;WIN LIST IT
B1.1:	TLNN	P2,E.LPAR	;PARITY ERR CAUSED RELOAD
	JRST	B1.2
	MOVE	T1,[SIXBIT/PARITY/]
	CAMN	T1,WKBUFF+WHYWHY	;SAME AS WHY RELOAD
	POPJ	P,		;WIN
B1.2:	TLNN	F,F.DEV		;/DEV?
	 JRST	B1.2A
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV
	 JRST	ABORT
	TLO	P2,E.LALL
B1.2A:	TLNE	P2,E.LALL	;ALWAYS LIST?
	POPJ	P,		;DOIT
	TLNE	P2,E.LPER	;PERFORMANCE 
	POPJ	P,		;WIN
	JRST	ABORT		;LISTING NOT FIT TO PRINT
FSTPAS:	MOVE	P1,HDRDAT
	MOVEM	P1,RELTIM
	JRST	FSPCON

BCK71:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)
	TLNN	F,F.DEV		;SAID /DEV?
	 JRST	BC71B		;NO
	MOVE	T1,DEV		;GET WHAT HE SAID
	CAMN	T1,[SIXBIT/LP100/]	;MATCH?
	 JRST	BC71A		;YES-FORCE LISTING
	MOVEI	P3,LPTNAM	;NO-CHECK FURTHER
	PUSHJ	P,DEVCHK	;
BC71A:	TLO	P2,E.LALL	;
BC71B:	TLNE	P2,E.LALL	;WANTS ALL?
	 POPJ	P,0		;YES-LIST IT
	JRST	ABORT		;NO-SORRY NO LISTING

BCK7:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)
	TLNN	F,F.DEV		;/DEV?
	 JRST	BCK7A
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV
	 JRST	ABORT
	TLO	P2,E.LALL
BCK7A:	TLNE	P2,E.LALL	;ALWAYS LIST?
	POPJ	P,		;DOIT
	TLNE	P2,E.LPER	;PERFORMANCE 
	POPJ	P,		;WIN
	JRST	ABORT		;LISTING NOT FIT TO PRINT
BCK3:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;PICKUP CHAR WORD
	TLNE	P2,E.LSUM	;SUMMARY DESIRED
	PUSHJ	P,SUM3
	TLNN	F,F.DEV		;/DEV?
	 JRST	BC3A
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV
	 JRST	ABORT
	TLO	P2,E.LALL
BC3A:	TLNN	P2,E.LALL!E.LPAR
	JRST	ABORT		;LOSE
	POPJ	P,		;WIN LIST IT


BCK6:	MOVE	P1,ERTYPE	;PICKUP ENTRY TYPE
	MOVE	P2,ENTCHR(P1)	;PICKUP CHARACTERISTICS WORD
	TLNE	P2,E.LSUM	;SUMMATION DESIRED
	PUSHJ	P,SUM6		;YES-DISPATCH
	TRNN	F,F.NDEV		;EDIT 325 SAID /NDEV:?
	 JRST	BCK6AA		;NO
	MOVEI	P3,CPENAM	;OFFSET
	PUSHJ	P,NDVCHK##	;GO CHECK
BCK6AA:	TLNN	F,F.DEV		;EDIT 124 SAID /DEV:?
	 JRST	BCK6A		;NO
	MOVEI	P3,CPENAM	;OFFSET
	PUSHJ	P,DEVCHK	;GO CHECK
BCK6A:	TLNE	P2,E.LALL	;ALWAYS LIST?
	POPJ	P,		;DOIT
	TLNN	P2,E.LNXM
	JRST	B6.1
	MOVE	T1,WKBUFF+CPENXM	;PICKUP NXM COUNT
	CAMN	T1,NXMTMP	;SAME AS OLD NXM COUNT?
	JRST	B6.1		;YES
	POPJ	P,		;IF TS GREATER THEN NXM CAUSED ERR
				;IF LESS RELOAD OCCURRED THEN ERROR
B6.1:	TLNN	P2,E.LPAR
	JRST	B6.2
	MOVE	T1,WKBUFF+CPEMPE
	JUMPE	T1,B6.2		;CLEARLY WAS NOT CAUSED BY PAR
	CAMN	T1,MPETMP	;SAME AS OLD
B6.2:	JRST	ABORT		;NOT CAUSED BY PAR
	POPJ	P,		;WIN LIST IT

BCK5:		;USE THE SAME CODE AS FOR BCK17
BCK17:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)
	TLNN	F,F.DEV		;/DEV?
	 JRST	BCK17A
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV
	 JRST	ABORT
	TLO	P2,E.LALL
BCK17A:	TLNE	P2,E.LALL	;ALWAYS LIST?
	POPJ	P,		;DOIT
	TLNE	P2,E.LPER	;PERFORMANCE 
	POPJ	P,		;WIN
	JRST	ABORT		;LISTING NOT FIT TO PRINT
BCK10:	MOVE	T1,ERTYPE	;PICKUP ENTRY TYPE
	MOVE	P4,ENTCHR(T1)	;PICKUP CHAR WORD
	TLNE	P4,E.LSUM	;SUMMATION DESIRED?
	PUSHJ	P,SUM10		;DOIT
	TLNN	F,F.TRY		;EDIT 126 SAID /RETRY?
	 JRST	BCK10A		;NO
	HRRZ	T1,WKBUFF+HDEECT	;# RETRIES
	CAMG	T1,RETRY	;ENTRY GREATER THAN SPEC?
	 JRST	ABORT		;NO-DON'T LIST
BCK10A:	TLNN	F,F.DEV		;USER SAY /DEV:?
	JRST	BC10.1		;NO
	SETOM	T2,T2
	MOVE	T1,DEV
	CAMN	T1,[SIXBIT/RP02/]
	MOVEI	T2,2
	CAMN	T1,[SIXBIT/RP03/]
	MOVEI	T2,3
	CAMN	T1,[SIXBIT/RD10/]
	MOVEI	T2,0
	CAMN	T1,[SIXBIT/RM10/]
	MOVEI	T2,1
	CAMN	T1,[SIXBIT/RS04/]
	MOVEI	T2,4
	CAMN	T2,MDEDTP	;MATCH?
	 JRST	.+3		;YES
	MOVEI	P3,HDENAM	;YES
	PUSHJ		P,DEVCHK
	TLNE	F,F.OSUM
	TLO	P4,E.LALL
	MOVE	T1,ERTYPE
	MOVEM	P4,ENTCHR(T1)
BC10.1:	TRNN	F,F.NDEV	;[325]"/NDEV:"?
	 JRST	BC10.A
	MOVEI	P3,HDENAM
	PUSHJ	P,NDVCHK	;GO CHECK
BC10.A:	TLNN	F,F.ID		;USER SAY /ID:?
	JRST 	BC10.2		;NO
	MOVEI	P3,HDEHID
	PUSHJ	P,IDCHK
BC10.2:	TLNN	F,F.STR		;SAID /STR?
	 JRST	BC10.4		;NOPE
	MOVEI	P3,HDELOG	;SETUP
	PUSHJ	P,STRCHK	;CHECK IT (EDIT #105)
BC10.4:	MOVE	T1,ERTYPE	;
	MOVE	P4,ENTCHR(T1)	;GET BACK CHAR WORD.
	TLNE	P4,E.LALL	;ALWAYS LIST?
	POPJ	P,		;YES-DOIT
	TLNN	P4,E.LPAR
	JRST	ABORT		;PAR ERROR IS THE ONLT SELECTABLE ERR ON DSK
				;NXM IS IMPOSSIBLE
	MOVE	T1,KONTYP		;GET CONTROLLER TYPE
	CAIN	T1,4		;RH10?
	JRST	BC10.3		;YES
	MOVE	T1,WKBUFF+HDESOF	;PICKUP CONI AT ERROR WORD
	TLNE	T1,4000		;PAR ERR BIT LIT?
	POPJ	P,		;YES-LIST
	JRST	ABORT		;LOSE
BC10.3:	MOVE	T1,WKBUFF+HDESOF	;GET CONI WORD
	TDNE	T1,[1B15!1B16!1B18!1B19];THESE ARE POSSIBLE
					;PAR ERR BITS-ANY SET?
	POPJ	P,0		;YES,LIST THIS ENTRY.
	JRST 	ABORT		;NO FORGET IT


BCK20:	MOVE	P1,ERTYPE
	MOVE	P4,ENTCHR(P1)	;GET CHAR WORD.
	TLNE	P4,E.LSUM	;WANT SUMMARY?
	PUSHJ	P,SUM20	;YES
	TLNN	F,F.TRY		;EDIT 126-USER SAID /RETRY?
	 JRST	BCK20A		;NO
	HRRZ	T1,WKBUFF+MAGRTC	;GET # RETRIES
	CAMG	T1,RETRY	;VALUE GREATER THAN SPEC?
	 JRST 	ABORT		;NO-DONT LIST
BCK20A:	TLNN	F,F.DEV		;DID USER SPECIFY DEVICE?
	JRST	BC20.1		;NO, GO AROUND
	MOVEI	P3,MAGNAM	;GET NAME FROM THIS ENTRY
	PUSHJ	P,DEVCHK
BC20.1:	TRNN	F,F.NDEV	;[325]DID USER SPECIFY DN-EVICE?
	JRST	BK20.1		;NO, GO AROUND
	MOVEI	P3,MAGNAM	;GET NAME FROM THIS ENTRY
	PUSHJ	P,NDVCHK
BK20.1:	TLNN	F,F.ID		;SAY /ID?
	JRST	BC20.2		;NO
	MOVEI	P3,MAGRID	;YES,SETUP
	PUSHJ	P,IDCHK
BC20.2:	TLNE	P4,E.LALL	;WANT ALL?
	POPJ	P,		;YES
	TLNN	P4,E.LPAR	;WANT PARITY ERRORS?
	JRST	ABORT		;NO, THAT'S ALL I CHECK FOR NOW.
	MOVE 	T1,WKBUFF+MAGICS	;YES, GET TMS CONI ERROR WORD.
	TRNE	T1,1B22		;THIS ENTRY HAS PARITY ERROR?*EDIT 130*
	POPJ	P,		;YES, LIST IT
	JRST	ABORT		;NO, FORGET IT
BCK40:	TLNN	F,F.DEV		;DID USER SAY DEV?
	JRST	BC40.1		;NO
	MOVEI	P3,USCNAM	;YES SETUP INDEX OF DEV NAME.
	PUSHJ	P,DEVCHK	;CHECK THIS ENTRY.
BC40.1:	TRNN	F,F.NDEV	;[325]/NDEV?
	 JRST	BC40.A
	MOVEI	P3,USCNAM
	PUSHJ	P,NDVCHK
BC40.A:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;PICKUP CHAR WORD
	TLNE	P2,E.LALL	;ALWAYS LIST?
	POPJ	P,		;YES-DOIT
	TLNE	P2,E.LPER	;PERFORMANCE ENTRY REQUESTED
	POPJ	P,		;WIN-LIST IT
	JRST	ABORT		;ALL OTHER REQUESTS ARE IGNORED
				;SINCE ENTRY TYPE 40 IS PER ONLY
BCK41:	MOVE	P1,ERTYPE
	MOVE	P4,ENTCHR(P1)
	TLNE	P4,E.LSUM
	 PUSHJ	P,SUM41
	TLNN	F,F.DEV		;DID USER SPECIFY DEV.
	JRST	BC41.1		;NO GO AROUND.
	MOVEI	P3,MSCNAM	;GET NAME FROM THIS ENTRY?
	PUSHJ	P,DEVCHK
BC41.1:	TRNN	F,F.NDEV	;[325]/NDEV?
	 JRST	BC41.A
	MOVEI	P3,MSCNAM
	PUSHJ	P,NDVCHK
BC41.A:	TLNN	F,F.ID		;/ID?
	JRST	BC41.2		;NO
	MOVEI	P3,MSCRID	;YES, SETUP
	PUSHJ	P,IDCHK
BC41.2:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;GET CHAR WORD
	TLNE	P2,E.LALL	;WANTS ALL?
	POPJ	P,		;YES
	TLNN	P2,E.LPER	;WANTS PERFORMANCE STATS?
	JRST 	ABORT		;NO, GOODBYE
	SKIPE	WKBUFF+MSCHRE	;YES, ANY HARD RED ERRORS?
	POPJ	P,0		;YES,LIST.
	SKIPE	WKBUFF+MSCHWE	;NO, WHAT ABOUT HARD WRITE ERRORS?
	POPJ	P,0		;YES.
	MOVE	T1,WKBUFF+MSCSRE	;GET # OF SOFT READ ERRORS
	CAML	T1,SRE		;ERRORS G.T. THRESHOLD?
	POPJ	P,0		;YES LIST
	MOVE	T1,WKBUFF+MSCSWE	;GET # OF SOFT WRITE ERRORS.
	CAML	T1,SWE		;ERRORS G.T. THRESHOLD?
	POPJ	P,0		;YES, LIST
	JRST	ABORT		;NO, FORGET IT.


SUM1:	MOVE	T2,WKBUFF+WHYWHY	;EDIT #106
	MOVEI	T1,RLDWHY		;INIT POINTER
RLDFND:	HLRZ	T3,(T1)			;GET POINTER TO NEXT
	JUMPE	T3,RLDNEW		;EXIT IF NO REASON
	MOVEI	T1,(T3)			;SETUP POINTER
	CAME	T2,1(T1)		;IS THIS THE ENTRY?
	 JRST	RLDFND			;NO,GET NEXT
	AOS	T3,(T1)			;BUMP
	TRNN	T3,-1			;BUT
	  SOS	(T1)			;NOT TOO MUCH(OVERFLOW)
	POPJ	P,0
	
RLDNEW:	AOS	T3,.JBFF##		;NEXT POSITION
	AOS	.JBFF##			;CLEAN HOUSE
	CAMG	T3,.JBREL##		;IS THERE ROOM?
	 JRST	RLDINS			;YES INSERT REASON
	MOVE	T4,T3			;DIFFERENT AC
	CORE	T4,			;GET MORE CORE
	 FATAL	<SYRNCA: NO CORE AVAILABLE>	;OPPS

RLDINS:	MOVEM	T2,(T3)			;SAVE REASON
	ADDI	T3,-1			;INITIAL COUNT AND ADDRESS
	HLRZM	T3,(T3)			;SET COUNT TO ONE
	HRLM	T3,(T1)		;POINT TO THIS BLOCK
	POPJ	P,0		;AND LEAVE
SUM3:	MOVEI	T1,TPETMP
	MOVEI	T2,TPEPER
	MOVE	T3,WKBUFF+MPETPE	;PICKUP # HARD P.E.
	PUSHJ	P,COMPAR	;LET SUBROUTINE DO UPDATING AS NECESSARY
	MOVEI	T1,SPETMP	
	MOVEI	T2,SPEPER
	MOVE	T3,WKBUFF+MPESPE	;PICKUP # SOFT MEM P.E.
	PUSHJ	P,COMPAR
	MOVEI	T1,UEPTMP
	MOVEI	T2,UEPPER
	HRRZ	P4,WKBUFF+MPAPAR	;PICKUP AOB POINTER TO DESIRED WORD
	SUB	P4,HEADWC	;SUBTRACT SIZE OF HEADER
	MOVE	T3,WKBUFF+MPEUEP(P4)	;PICKUP # USER-ENABLED P.E.
	PUSHJ	P,COMPAR
	MOVEI	T1,PCSTMP
	MOVEI	T2,PCSPER
	MOVE	T3,WKBUFF+MPEPCS(P4)	;PICKUP # CHN P.E. NOT DETECTED BY CPU
	PUSHJ	P,COMPAR
	POPJ	P,		;DONE WITH SUM3
SUM6:	MOVEI	T1,NXMTMP
	MOVEI	T2,NXMPER
	MOVE	T3,WKBUFF+CPENXM	;PICKUP # NXMS
	PUSHJ	P,COMPAR	;GO DO COMPARISON AND UPDATING
S6.1:	MOVEI	T1,MPETMP
	MOVEI	T2,MPEPER
	MOVE	T3,WKBUFF+CPEMPE	;PICKUP COUNT OF NXM SEEN BY CHANNEL
	PUSHJ	P,COMPAR
S6.2:	MOVEI	T1,DPETMP
	MOVEI	T2,DPEPER
	MOVE	T3,WKBUFF+CPEDPE	;PICKUP # DATA P.E. SEEN FROM CONTROLLER
	PUSHJ	P,COMPAR
	POPJ	P,		;EXIT BACK TO BITCHKER

SUM10:	MOVE	P1,DVINDX
	HRRZ	P2,SOFDSP(P1)
	HLRZ	P1,SOFDSP(P1)
	;edit #110
	ifn	DEBUGA,<
	MOVEI	T1,HDETMP
	MOVEI	T2,HDEPER
	MOVE	P4,WKBUFF+HDEHCT	;PICKUP HARD ERR WORD
	HLRZ	T3,P4		;PICKUP # HDEV ERRS
	PUSHJ	P,COMPAR
	MOVEI	T1,HDTTMP
	MOVEI	T2,HDTPER
	HRRZ	T3,P4		;PICKUP # HDAT ERRORS
	PUSHJ	P,COMPAR
	MOVEI	T1,SDETMP
	MOVEI	T2,SDEPER
	MOVE	P4,WKBUFF+HDESCT
	HLRZ	T3,P4		;PICKUP # SDEV ERRS
	PUSHJ	P,COMPAR
	MOVEI	T1,SDTTMP
	MOVEI	T2,SDTPER
	HRRZ	T3,P4		;PICKUP # SDAT ERRORS
	PUSHJ	P,COMPAR
	>	;end edit#110
	MOVEI	T1,ERRSAT(P1)
	MOVEI	T2,ERRSAT(P2)
	LDB	T3,[POINT 12,WKBUFF+HDEMCT,11]	;PICKUP # SAT FAILS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG	;DID COUNT CHANGE ON THIS ERROR
	TLO	S,S.SAT		;SAY SAT FAILURE
	MOVEI	T1,ERRRIB(P1)
	MOVEI	T2,ERRRIB(P2)
	LDB	T3,[POINT 12,WKBUFF+HDEMCT,23]	;PICKUP # RIB ERRS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.RIB
	MOVEI	T1,ERRCHK(P1)
	MOVEI	T2,ERRCHK(P2)
	LDB	T3,[POINT 12,WKBUFF+HDEMCT,35]	;PICKUP # CHKSUM ERRS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.CHK

	;FALL INTO S10.1 ROUTINE
S10.1:	MOVEI	T1,ERRINC(P1)
	MOVEI	T2,ERRINC(P2)
	HRRZ	T3,WKBUFF+HDEPCT	;[302]PICKUP # SEEK INCOMP ERRORS
	PUSHJ	P,COMPAR
	MOVEI	T1,ERRHN1(P1)
	MOVEI	T2,ERRHN1(P2)
	LDB	T3,[POINT 9,WKBUFF+HDEHNG,8]	;PICKUP # HARD HANGS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG1
	MOVEI	T1,ERRHN2(P1)
	MOVEI	T2,ERRHN2(P2)
	LDB	T3,[POINT 9,WKBUFF+HDEHNG,17]	;PICKUP # SOFT HANG TYPE 1
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG2
	MOVEI	T1,ERRHN3(P1)
	MOVEI	T2,ERRHN3(P2)
	LDB	T3,[POINT 9,WKBUFF+HDEHNG,26]	;PICKUP # SOFT HANGS TYPE 2
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG3
	MOVEI	T1,ERRHN4(P1)
	MOVE	T2,ERRHN4(P2)
	LDB	T3,[POINT 9,WKBUFF+HDEHNG,35]	;PICKUP # SOFT HANGS TYPE 3
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG4
	;EDIT 122
	MOVEI	T1,ERRCWF(P1)
	MOVE	T2,ERRCWF(P2)
	LDB	T3,[POINT 9,WKBUFF+HDECCT, 35]	;# OF TERM CHK FAILS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.CWF			;SAY FAILURE IN S
	;edit #110
	ifn	DEBUGA,<
	MOVEI	T1,REDTMP
	MOVEI	T2,REDPER
	MOVE	T3,WKBUFF+HDETRC	;PICKUP TOTAL # READS
	PUSHJ	P,COMPAR
	MOVEI	T1,WRTTMP
	MOVEI	T2,WRTPER
	MOVE	T3,WKBUFF+HDETWC
	PUSHJ	P,COMPAR
	MOVEI	T1,SEKTMP
	MOVEI	T2,SEKPER
	MOVE	T3,WKBUFF+HDETSC
	PUSHJ	P,COMPAR
	>	;end edit #110
	MOVEI	P2,HDEECT
	MOVEI	P3,HDESOF	;SETUP
	PUSHJ	P,CNISUM		;GO PERFORM CONI BIT SUMMING
	SKIPN	HDVER1		;VERSION 1 HEADER?
	 POPJ	P,0		;NO-LEAVE NOW
	LDB	T2,[POINT 9,WKBUFF+HDECCT,17]	;GET # SLOTS IN BAT BLOCK
	CAIL	T2,5		;<5= GIVE WARNING
	 POPJ	P,0		;ITS OK
	MOVE	T2,WKBUFF+HDELOG	;GET STR NAME
	PUSHJ	P,TTYSIX	;CONVERT AND LIST ON USER'S TTY
	WARN	< STRUCTURE FOUND WITH LESS THAN 5 BAT BLOCK SLOTS LEFT>
		;FINISH LINE WITH WARNING AND GET FREE CRLF
	POPJ	P,0		;RETURN TO BCK ROUTINES

SUM20:	MOVE	T4,DVINDX	;STILL SET FROM TMCHAR
	MOVE	T4,DEVDSP(T4)	;SOME ADDRS
	MOVE	T1,WKBUFF+MAGICS	;CONI WORD
	TDNN	T1,[1B11!1B12!1B13!1B18!1B27]	;ANYTHING TO COUNT?
	 POPJ	P,0		;SHORT WAY HOME
	MOVE	T2,WKBUFF+MAGRTC
	HRRZ	T3,T4		;SOFT ERROR COUNTER ADDR
	TLNE	T2,ERRHRD	;BUT IF HARD ERROR
	 HLRZ	T3,T4		;CHANGE ADDR
	TLNE	T1,1B29		;WAS IT CTL PAR
	 AOS	,0(T3)		;YES BUMP COUNT
	TLNE	T1,1B31		;MEM PAR
	 AOS	,1(T3)
	TLNE	T1,1B30
	 AOS	,2(T3)		;NXM
	TRNE	T1,1B18	;UNIT HUNG
	 AOS	,4(T3)
	TRNE	T1,1B27
	 AOS	,3(T3)		;OVRN
	POPJ	P,0		;GO HOME
SUM40:	POPJ	P,

	;ADDED WITH EDIT 112
SUM41:	MOVE	P3,WKBUFF+MSCNAM
	TRNE	P3,7777	;EDIT132  FUNNY NAME?
	 PUSHJ	P,FIXNAM	;FIX IT
	MOVE	T1,[IOWD NAMLTH,NAMTBL]
	PUSHJ	P,.NAME
	 PJRST	BADNAM
	TLZ	T1,-1
	SUBI	T1,NAMTBL
	HRRZ	P4,DEVDSP(T1)
	HLRZ	P3,DEVDSP(T1)	;SAVE BOTH HD &SF ADDRS
	MOVE	P1,WKBUFF+MSCWRC	;WORDS READ
	PUSHJ	P,WDCNT		;GO DO IT
	MOVE	T1,WKBUFF+MSCHRE
	ADDM	T1,6(P3)	;UPDATE HARD COUNTER
	MOVE	T1,WKBUFF+MSCSRE
	ADDM	T1,6(P4)	;SOFT COUNTER
	POPJ	P,0	;GO BACK TO BCK41

	;SUMUPD -- SUBROUTINE TO AUTOMATICALLY UPDATE ALL PERMANENT
	;SUMMARY COUNTERS PRIOR TO SUMMARY LISTING
	;A DUMMY MACRO DUMFLG IS USED TO GENERATE
	;THE NECESSARY CODE AS FOLLOWS
	;SKIPE	T1,XXXTMP	;PICKUP TEMP COUNTER
	;ADDM	T1,XXXPER	;INCREMENT PERM COUNTER
	;DO NEXT COUNTER SAME.......
	;modified by edit #110
	DEFINE	TBLFLG(A)<
	setz	t1,
	exch	t1,a'TMP
	ADDM	T1,A'PER
>

	;NOW THE ACTUAL CODE GENERATION

;	XLIST
SUMUPD:	DUMFLG
	LIST


;NOW GENERATE THE SOFTWARE SUMMARY COUNTERS UPDATE
;also modified by edit #110
	DEFINE	DUMDV(A)<
	ZZ==0
REPEAT NUMSFB,<
	setz	t1,
	exch	t1,a'ST+zz
	ADDM	T1,A'SP+ZZ
	ZZ==ZZ+1
>>
;	XLIST
;	DUMDP
;	DUMFH
;	DUMRP
	LIST
	XLIST
	DUMDP
	DUMFH
	DUMRP
	LIST

	POPJ	P,		;RETURN
	SUBTTL	STORAGE LOCATIONS
INPSPC:	EXP	13
	SIXBIT/SYS/
	XWD	0,IBUFF
OUTSPC:	EXP	0
	SIXBIT/DSK/
	XWD	OBUFF,0
ERRFIL:	XWD	0,35
	Z
	SIXBIT/ERROR/
	SIXBIT/SYS/
	BLOCK	32
LSTFIL:	SIXBIT/ERROR/
	SIXBIT/LST/
	Z
	Z
	;HERE IS THE CODE WHICH WILL BE BUT INTO THE LOW SEG
	;AND WILL BE CALLED TO OVERLAY HIGH SEGMENTS.
	;EDIT #120


	SETZM	.JBSYM		;TO ALLOW DDT TO WORK
	SETZM	.JBUSY		;WHILE DEBUGGING VARIOUS HIGH
				;SEGMENTS. PUT A BREAKPOINT
				;AT ROUTINES WHICH CALL OVRLAY
				;THEN SET BREAKPOINT AT THE
				;RETURN FROM THE GETSEG AND OPEN
				;THE NEW SYMBOL TABLE
				;AND CONTINUE DEBUGGING.
	MOVEI	T1,OVRBLK	;SPEC BLOCK SETUP BY OUR CALLER
	GETSEG	T1,
	 HALT			;STD ERROR MESSAGES ARE OK
	HRLZI	17,SAVEAC	;COPY BACK
	BLT	17,17		;THE AC'S
	HRRZ	15,400000	;THAT'S THE START OF THE NEW SEG
	JRST	@15		;NOW GO THERE



IARGST:	Z
	Z
	CHROUT		;LOCATION OF TYPEOUT ROUTINE IN SYSERR
	Z
	Z
IAREND==.-1
IARGLN==<IAREND-IARGST>+1	;LENGTH OF ARG BLOCK FOR .ISCAN


DUMDAY:	121165		;DUMMY NBS DAY FOR USE BY SCAN
KONMSK:	RCMASK			;MASK FOR ERROR BITS IN RC10 TYPE DEVICE
	RPMASK			;MASK FOR ERROR BIT IN A RP10 TYPE DEVICE
	SFMASK			;SOFTWARE DETECTED ERROR MASK
	TMMASK
	RHMASK
	LPTMSK



MINERB:	MINRCB
	MINRPB
	MINSFB
	MINTMB
	MINRHB
	MINLPT

ERINDX:	RCINDX
	RPINDX
	SFINDX
	TMINDX
	RHINDX
	LPTIND

IDVFLT:	SIXBIT/SYS/		;DEFAULT FILE SPECIFICATIONS
IFLFLT:	SIXBIT/ERROR/
IEXFLT:	SIXBIT/SYS/
ODVFLT:	SIXBIT/DSK/
OFLFLT:	SIXBIT/ERROR/
OEXFLT:	SIXBIT/LST/

PDLPNT:	IOWD	LPDL,PDLST
	SUBTTL	DUMMY MACRO EXPANSION AREA


	;THE FOLLOWING MACRO CODE UTILIZES THE PRINCIPLE OF THE DUMMY
	;MACRO USED EARLIER AND REDEFINES TBLENT TO GENERATE VAIOUS
	;NECESSARY DISPATCH TABLES

	;MACRO TO CREATE A TABLE CONTAINING OFFSET INTO OTHER TABLES
	;WHICH WERE PREVIOUSLY INDEXED BY ERROR TYPE(VER 3 & EARLIER). ALLOWS
	;HOLES TO BE IN SEQUENCE OF ERROR TYPES WHICH ARE USED.

	;THIS FIRST TABLE CONTAINS ALL THE ERROR  TYPES
	;KNOWN TO ALL SYSERR PARTS. THE SECOND IS THE TABLE
	;OF TYPES PROCESSED BY THE SEGMENT.
	;EDIT #120.
	SALL
	DEFINE	TBLENT(A,B,C,D,E)<
	XWD  0,A
	>

ALLTBL:	DUMENT

	ALLLTH=<.-1>-ALLTBL+1		;LENGTH OF ERROR INDEX TABLE

	;TABLE OF ERRORS PROCESSED BY THIS ENTRY AND,
	; BRIEF PROCESS TABLE POINTERS  -  EDIT [724]
DEFINE	TBLENT(A,B,C,D,E,F)<
	IFIDN<D><PROCSA><
		XWD  F,A
	>
>

ERRTBL:	0		;FIRST FOUND MUST NOT BE 0
	DUMENT

	ERRLTH=<.-1>-ERRTBL+1		;LENGTH OF ERROR INDEX TABLE


	;THE ENTRY PROCESSING TABLE
	;THIS TABLE MUST BE INDEXED BY THE CONTENTS OF ALLIND

	DEFINE	TBLENT(A,B,C,D,E)<
	IFIDN<D><PROCSA><
	XWD	C,D
	TYPMAX==A>
	IFDIF<D><PROCSA><
	XWD	0,D
	TYPMAX==A>
	>
PCSTBL:	DUMENT


	;GENERATE THE VARIOUS ASCIZ MESSAGES TO BE USED FOR HEADER
	;ENTRY TYPE IDENTIFICATION
	;FORMAT WILL BE MESS(#) WHERE MESS IS THE ENTRY TYPE
	;DESCRIPTION AND # IS THE ERROR TYPE

	DEFINE	TBLENT(A,B,C,D,E)<
	IFIDN<D><PROCSA><
	[ASCIZ/B/]
	>>


	;GENERATE THE TEXT


TYPMES:	0
	DUMENT
	LIST

	;END OF ENTRY DESCRIPTOR GENERATOR


	;GENERATE THE DISPATCH TABLE TO ENTRY SUMMATION AND BIT CHECK ROUTINES
	;ALL WILL RETRN VIA POPJ	P,
	;TABLE IS INDEXED BY ERROR TYPE CODE

	DEFINE	TBLENT(A,B,C,D,E)<
	IFIDN<D><PROCSA><
	IFDIF<B><UNKNOWN TYPE>,<	XWD	0,BCK'A>
	IFIDN<B><UNKNOWN TYPE>,<	XWD	0,[POPJ	P,]>
	>>
	;GENERATE THE TABLE

BITCHK:	0
	DUMENT


	;GENERATE THE TABLE OF LINE COUNTS FOR OUTPUT LISTING

	DEFINE	TBLENT(A,B,C,D,E)<
	IFIDN<D><PROCSA><
	XWD	0,E
	>>

	RADIX	10

LINE:	0
	DUMENT

	RADIX	8

	;GENERATE THE VARIOUS ENTRY CONTROL TABLES USING THE MACRO TBLWRD
	;TO GENERATE TABLES

;***********WATCH OUT THIS IS A NON-STD DEFINITION OF TH MACRO******
;*************IT'S NOT LIKE THE OTHERS IN OTHER HIGH SEG'S!!!!!!!!!
	DEFINE	TBLWRD(A,B,C,D,E,F)<
	IFDIF<D><SPECL>,<	BYTE	(6)B(9)C(3)D(18)T'A'E>
	IFIDN<D><SPECL>,<	BYTE	(6)B(9)C(3)D(18)F>

>

.BR001:	BRF001
.CT001:	DUM001
	Z
.BR003:	BRF003
.CT003:	DUM003
	Z
.BR005:	BRF005
.CT005:	DUM005
	Z
.BR006:	BRF006
.CT006:	DUM006
	Z
.BR007:	BRF007
.CT007:	DUM007
	Z
.BR010:	BRF010
.CT010:	DUM010
	Z
.BR017:	BRF017
.CT017:	DUM017
	Z
.BR020:	BRF020
.CT020:	DUM020
	Z
.BR040:	BRF040
.CT040:	DUM040
	Z
.BR041:	BRF041
.CT041:	DUM041
	Z
.BR071:	BRF071
.CT071:	DUM071
	Z


	;END OF ENTRY TABLE GENERATION
	;GENERATE THE NECESSARY ASCIZ TEXT FOR NON-SPECIAL ROUTINES

	DEFINE	TBLWRD(A,B,C,D,E,F)<
	IFDIF	<D><SPECL>,<
T'A'E:	ASCIZ/
F/
>>


	;WHAT IS XLISTED IS THE DUMALL CALL AND FOLLOWING CODE.
	XLIST
	DUMALL
	LIST




	;END OF ASCIZ TEXT MACRO EXPANSION
	;SWITCH TABLES
	;THE FOLLOWING TABLES WILL BE GENERATED VIA THE DUMMY MACRO
	;DUMCH1
	;THE FIRST IS A DISPATCH TABLE TO BYTES REPRESENTING BITS TO SET
	;IN THE ENTCHR TABLE
	;NEXT IS THE ACTUAL BYTES THEMSELVES

	;TABLE FOR DISPATCH TO THE BYTE OPERANDS

	DEFINE	TBLCH1(A,B,C,D,E,F,G)<
	XWD	0,BYT'G
>

	;MAKE DISPATCH TABLE

BYTDSP:	DUMCH1
	;NOW THE BYTES THEMSELVES


	DEFINE	TBLCH1(A,B,C,D,E,F,G)<
BYT'G:	BYTE (6) B,77,C,77,D,77,E,77,F,77
>


	DUMCH1
	;SWITCH MACRO EXPANSION NEXT


	;DEFINE THE SWITCHES WE RECOGNIZE

	DEFINE	TBLCH1(A,B,C,D,E,F,G)<
	SS	(A,A,0)
>
	DEFINE	TBLCH2(A,B,C)<
	SP	(A,A,B,C)
>

	;CALL MACRO TO DEFINE DEFAULTS

	DEFVAL

	;NOW MAKE SWTCHS MACRO FOR USE WITH DOSCAN LATER

	DEFINE	SWTCHS<
	DUMCH1
	DUMCH2
>

	DOSCAN(SWTAB)


	SALL
	;GENERATE THE CONI BIT TEXT AND ADDRESS DISPATCHER
	RADIX	10		;****** NOTE WELL *****

	DEFINE	TBLDEV(A,B)<
	[ASCIZ\B',\]
>

	RC10DV:	DUMRC1

	DEFINE	TBLDEV(A,B)<
	[ASCIZ\B',\]
>
	RP10DV:	DUMRP1


	DEFINE	TBLDEV(A,B)<
	[ASCIZ\B',\]
>

	SOFTDV:	DUMSF1


	DEFINE	TBLDEV(A,B)<
	[ASCIZ\B',\]
>
	TM10DV:	DUMTM1
	DEFINE	TBLDEV(A,B)<
	[ASCIZ\B',\]
>
	RH10DV:	DUMRH1

	DEFINE	TBLDEV(A,B)<
	[ASCIZ\B',\]
>
	LPTDEV:	DUMLPT
	;NOW GENERATE THE ERROR BIT VS INDEX BIT TABLES
	;THIS ALLOWS NON-CONTIGUOUS ERROR BITS IN CONI WORD
	;TO BE COUNTED IN CONTIGUOUS COUNTERS

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	RCINDX+A-MINRCB
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>

;	XLIST
RCINDX:	REPEAT	36-MINRCB,<0>
	LIST
	ZZ==0
	DUMRC1

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	LPTIND+A-MINLPT
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
LPTIND:	REPEAT	36-MINLPT,<0>
	ZZ==0
	DUMLPT


	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	RPINDX+A-MINRPBA
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>

;	XLIST
RPINDX:	REPEAT	36-MINRPB,<0>
	LIST
	ZZ==0
	DUMRP1


	DEFINE 	TBLDEV(A,B)<
	ZZP==.
	RELOC	TMINDX+A-MINTMB
	ZZ
	ZZ=ZZ+1
	RELOC	ZZP
>
;	XLIST
TMINDX:	REPEAT	36-MINTMB,<0>
	LIST
	ZZ==0
	DUMTM1

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	SFINDX+A-MINSFB
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>

;	XLIST
SFINDX:	REPEAT	36-MINSFB,<0>
	LIST
	ZZ==0
	DUMSF1
	DEFINE TBLDEV(A,B)<
	ZZP==.
	RELOC	RHINDX+A-MINRHB
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>
;	XLIST
RHINDX:	REPEAT	36-MINRHB,<0>
	LIST
	ZZ==0
	DUMRH1

	RADIX	8	;******DONE WITH RADIX 10******
	;GENERATE SIXBIT TABLE OF DEVICE NAMES

	DEFINE	DUMDV(A)<
	SIXBIT/A/
>
NAMTBL:	DUMDVA
NAMLTH=<.-1>-NAMTBL+1	;LENGTH OF TABLE OF SIXBIT NAMES
	
;USING SAME DEFINITION OF MACRO NOW GENERATE
	;LIST OF ONLY MASSBUS DEVICE NAMES

MASNAM:	DUMFS
	DUMRP

	MASLTH=<.-1>-MASNAM+1	;LENGTH OF THIS TABLE

	;GENERATE LIST OF POINTERS TO 5 WORD SCRATCH BLOCKS

	;GENERATE LIST OF POINTERS TO 5 WORD SCRATCH BLOCKS

	;FOR ALL DEVICES ON THE SYSTEM
	
DEFINE	DUMDV	(A)<
	XWD	0,A'BK
	>
BKLOC:	DUMDVA

	;GENERATE CONI BIT ERROR DISPATCHER
	;RH = SOFT ERROR POINTER
	;LH = HARD ERROR POINTER

	DEFINE	DUMDV(A)<
	XWD	A'HD,A'SF
>

DEVDS2::
DEVDSP:	DUMDVA



	DEFINE	DUMDV(A)<
	XWD	A'ST,A'SP
>
	;ST=STORAGE TEMP,SP=PERM.
SOFDSP:	DUMDVA


FOO:	[ASCIZ\
****************************************************
*						   *
\]
FOOA:	[ASCIZ\*	THIS IS THE TENTH ERROR ON THIS TAPE!      *
\]
FOOB:	[ASCIZ\*	NO MORE ENTRIES WILL BE LISTED FOR THIS    *
*	TAPE.  SEE THE PERFORMANCE ENTRY FOR       *
\]
FOOC:	[ASCIZ\*	THIS TAPE TO FIND THE TOTAL NUMBER OF      *
*	ERRORS.     				   *
*						   *
****************************************************
\]

	END	STARTA