Google
 

Trailing-Edge - PDP-10 Archives - dec-10-omona-u-mc9 - sysers.mac
There are 16 other files named sysers.mac in the archive. Click here to see a list.
	TITLE	SYSERS -- SYSTEM ERROR FILE PROCESSOR VERSION7(433)	OCT 30, 1972	SUBTTL	K. COYE/ RLD


	SUBTTL	SUMMARY LISTING ROUTINES

	SEARCH	SYRUNV	;OUR UNIVERSAL FILE
	SEARCH	SYRLOW
	SEARCH	SCNMAC


	.REQUIRE SYRLIB
	SALL

	TWOSEG
	.JBVER==137
	LOC	.JBVER

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


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

	EXTERNAL 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,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,MASLT2
	



	RELOC	400000

	;SUMLST -- SUBROUTINE TO LIST SUMMARY DATUM ON REQUEST
	;SUMMARY TOTALS ARE STORED IN WORDS SUMFST THRU SUMEND
	;ROUTINE WILL CHECK E.LSUM BIT AND OUTPUT DATA ON A ENTRY
	;BY ENTRY TYPE BASIS
	;ENTRIES NOT USED WILL CONTAIN POPJ IN DISPATCH TABLE

	;DUMMY ROUTINES DEFINED HERE TO ALLOW COMPILE
	;WITH SYRLIB
BITCHK:
DEVTYP:
DUMDAY:
ERINDX:
ERRLTH:
ERRTBL:
KLEDMP:
KONMSK:
LINE:
MINERB:
PCSTBL:


START:	MOVE	P,PDLPNT	;RESET THE STACK
	MOVEI	T1,CHROUT	;OUR TYPO ROUTINE
	PUSHJ	P,.TYOCH##	;INIT SCAN ROUTINES
	PUSHJ	P,TTLST	;TYPE TITLE LINE
	TYPEIT	<
	- SYSTEM SUMMARY FOR SYSTEM # >
	MOVE	T1,SYSSER	;GET SERIAL #
	PUSHJ	P,.ODECW	;WITH A PERIOD
	TYPEIT	<
*********************************************************************************


>
	PUSHJ	P,SUMUPD	;GO UPDATE ALL COUNTERS

	PUSHJ	P,ENVLST	;GO DO ENVIRONMENT TYPEOUT
				;THINGS LIKE VERSION,FILE SPECS,SWITCHES,ETC.
	PUSHJ	P,TOTPRT	;PRINT OCCURANCE COUNTS
	MOVSI	P4,ENTLTH	;SETUP AOBJ POINTER TO ENTCHR TABLE
	MOVNS	P4,P4
SMLOOP:	MOVE	T1,ENTCHR(P4)
	TRNN	T1,E.RCNT	;ANY ENTRIES PROCESSED AT ALL?
	JRST	SMBUMP		;BUMP AND GO
	TLNN	T1,E.LSUM
	JRST	SMBUMP		;TRY NEXT
	PUSH	P,P4		;SAVE POINTER
	HRRZ	T1,P4
	PUSHJ	P,ERRINS	;GO FIND CORRECT INDEX
	HRRZ	P4,T4	;RESTORE POINTER
	PUSHJ	P,@SUMDSP(P4)	;GO PROCESS SUMMARY LISTING
	POP	P,P4		;RESTORE POINTER
SMBUMP:	AOBJN	P4,SMLOOP
	JRST	GOBACK		;SUMMARY DONE RETURN TO SYSERR.



	;HERE WHEN THE SUMMARY IS DONE TO REPLACE THIS
	;SEGMENT WITH SYSERR AND START OVER AGAIN.

GOBACK:	PUSHJ	P,.TCRLF
	CLOSE	INPCHN,
	CLOSE	OUTCHN,		;CLOSE ALL FILES
	MOVE	T1,[SIXBIT/SYSERR/]
	MOVEM	T1,OVRBLK+1	;CORRECT SPOT IN SPEC AREA.
	SETZ	15,
	MOVE	11,OVRBLK	;THIS IS THE DEVICE SYSERR
	MOVE	7,OVRBLK+4	;WAS ORIGINALLY CALLED FROM.WE
				;WILL PRESERVE IT ACROSS THE GETSEG
				;IN THE AC IT ORIGINALLY WAS
				;FOUND AND SYSERR WILL RETURN IT
				;TO OVRBLK AFTER CLEARING ALL
				;THE LOW SEG STORAGE AREA.
	MOVE	7,OVRBLK+4		;DO THE SAME FOR [P,PN] ALSO
	MOVEM	17,SAVEAC+17	;SAVE THE AC'S
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16


	JRST	OVRLAY		;REPLACE US PLEASE WITH SYSERR!!!
	;TTLST -- SUBROUTINE TO OUTPUT TITLE BLOCK
	;INFO OUTPUT IS DATE AND TIME AND USER REQUESTED STRING
	;CALL	PUSHJ	P,TTLST
	;
	;RETURN	CALL+1
	;DOES NOT CHECK PAGE LIMIT FOR SYSERS

TTLST:	MOVEI	T1,14
	PUSHJ	P,CHROUT	;DO FORM FEED
	TYPEIT	<
SYSTEM ERROR REPORT COMPILED ON >
	SKIPE	TOPMON		;TOPS20 RUNNING?
	 JRST	TTLS1		;YES
	PUSHJ	P,.TDATN	;GO TYPE TODAYS DATE
	TYPEIT	< AT >
	PUSHJ	P,.TTIMN	;GO TYPE CURRENT TIME
	JRST	TTLS2		;NOW GO AROUND TOPS20

TTLS1:	SETOB	T2,T3	;CURRENT TAD AND DEFAULT OUTPUT FORMAT
	HRROI	T1,DATLOC	;STR CONVERTED ASCIZ HERE
	ODTIM			;CONVERT
	HRRZI	T1,DATLOC
	PUSHJ	P,.TSTRG	;NOW LIST IT

TTLS2:	TYPEIT	<	PAGE >
	AOS	T1,PAGNUM
	PUSHJ	P,.TDECW
	POPJ	P,

	;TOTPRT PRINTS OUT A TOTAL OF EACH ERROR TYPE

TOTPRT:	TYPEIT	<

ENTRY OCCURANCE COUNTS>
	MOVSI	P4,ENTLTH	;SETUP AOBJ POINTER TO ENTCHR TABLE
	MOVNS	P4,P4
TOTCON:	HRRZ	P3,ENTCHR(P4)	;PICKUP ENTCHR WORD
	ANDI	P3,E.RCNT		;[304]GET COUNT OF ENTRIES
	JUMPE	P3,CNTINC	;JUST BUMP AOBJ POINTER IF = 0
	PUSH	P,P4		;SAVE POINTER
	HRRZ	T1,P4		;SAME AS ERTYPE
	PUSHJ	P,ERRINS	;FIND INDEX TO MESSAGES
	HRR	P4,T4		;RESTORE THE INDEX
TOTTYP:	TYPEIT	<
	TOTAL >
	MOVE	T1,TYPMES(P4)	;GET ADDRESS OF ENTRY HEADER
	PUSHJ	P,.TSTRG
	TYPEIT	<:		>
	MOVE	T1,P3		;GET THE COUNT
	PUSHJ	P,.ODECW
	POP	P,P4		;RESTORE IT INDEX
CNTINC:	AOBJN	P4,TOTCON	;BUMP COUNTER & TRY AGAIN
	POPJ	P,

	;ERRINS--ROUTINE TO FIND OUR INDEX INTO HEADERS,ETC
	;	T1=ERRTYPE
	;CALL PUSHJ P,ERRINS
ERRINS:	MOVEI	T2,ALLLTH	;LENGTH OF TABLE
	SETZB	T3,T4	;SOME WORK SPACE
ERRIS1:	MOVE	T3,ALLTBL(T4)	;GET NEXT INDEX VALUE
	CAMN	T1,T3		;MATCH?
	JRST	ERRIS2		;YES
	AOS	T4		;UPDATE
	CAIE	T4,ALLLTH+1	;END OF TABLE?
	JRST	ERRIS1		;NOT YET
	POPJ	P,0		;SOMETHING IS IN T4
ERRIS2:	MOVEM	T4,ALLIND	;STORE GOOD INDEX VALUE
	POPJ	P,0		;AND RETURN
	;ENVLST -- SUBROUTINE TO LIST ENVIRONMENT INFORMATION AT SUMMARY TIME
	;CALL	PUSHJ	P,ENVLST
	;TYPES SYSERR VERSION NUMBER,FILE SPECS,SWITCHES
	;RETURN	CALL+1

ENVLST:	TYPEIT	<
FILE ENVIRONMENT>
	TYPEIT	<
	SYSERR VERSION >
	MOVEI	T1,VSYSER	;PICKUP VERSION NUMBER
	PUSHJ	P,.TOCTW


;EDIT 106
IFG <VMINOR>,<
IFG <VMINOR+"A"-"Z">,<	;IF MANY PATCHES
	MOVEI	T1,<<VMINOR-1>/<"Z"-"A">>+"A"
	PUSHJ	P,.TCHAR
>		;END MASSIVE EDITS

	MOVEI	T1,"A"+VMINOR-1-<"Z"-"A">*<<VMINOR-1>/<"Z"-"A">>
	PUSHJ	P,.TCHAR	;THANKS FOR EDIT 106!!!
>
	TYPEIT	<(>
	MOVEI	T1,VEDIT
	PUSHJ	P,.TOCTW
	TYPEIT	<)>

	;MORE OF 106
IFG <VWHO>,<
	MOVNI	T1,VWHO	;IF NON-DEC
	PUSHJ	P,.TDECW	;AND LIST
>

	TYPEIT	<
	INPUT FILES:	>
	MOVE	T1,I.DEV	;GET INPUT DEV
	CAME	T1,[SIXBIT/QAP/]	;DEFAULT FOR TOPS20?
	 JRST	ENVLSA		;NO
	MOVE	T1,[SIXBIT/SYS/]	;CHANGE BACK FOR OUTPUT
	MOVEM	T1,I.DEV
ENVLSA:	MOVEI	T1,I.ST
	PUSHJ	P,.TFBLK	;TYPE INPUT FILE SPEC

	TLNN	F,F.DISK	;DID WE DO EXTENDED LOOKUP ON INPUT DEV
	JRST	SHRTDT		;NO ,DO OUTPUT FOR SHORT LOOKUP
	TYPEIT	<  CREATED: >
	SKIPE	TOPMON		;TOPS20 RUNNING
	JRST	ENVLS1
	MOVE	T1,FILDAT
	PUSHJ	P,TYPNBS
	JRST	ENVLS2	;GO AROUND TOPS20
ENVLS1:	HRROI	T1,DATLOC	;WHERE TO STORE IT
	HRLZI	T3,202100	;FORMAT FOR OUTPUT
	MOVE	T2,FILDAT	;WHAT TO CONVERT
	ODTIM
	HRRZI	T1,DATLOC	
	PUSHJ	P,.TSTRG	;NOW LIST IT
ENVLS2:	SKIPE	CURIND		;MORE THAN 1 FILE PROCESSED?
	 PUSHJ	P,EXTFIL	;LIST OTHER FILES TOO
				;(107)
ENVCON:	TYPEIT	<
	OUTPUT FILE:	>
	MOVEI	T1,O.ST
	PUSHJ	P,.TFBLK	;TYPE OUTPUT SPECIFICATION
	TYPEIT	<
	SWITCHES:	>

	MOVSI	P4,FLGSTP	;SETUP FOR AOBJ OF FLAG TABLE
	MOVNS	P4,P4
				;DON'T DO /BEGIN OR /END YET
SWTCON:	SKIPN	T1,FLGST(P4)	;SWITCH TYPED BY USER?
	PUSHJ	P,TYPSWT	;GO TYPE IT
	AOBJN	P4,SWTCON	;LOOP
DEVSW:	MOVE	T1,[-1]
	CAMN	T1,DEV		;HAS DEV BEEN MODIFIED?
	JRST	NDEVSW		;NO.
	TYPEIT	(/DEV:)		;YES, LIST THIS SWITCH.
	MOVE	T1,DEV		;GET WHAT THE USER TYPED.
	PUSHJ	P,.TSIXN	;AND OUTPUT IT.
NDEVSW:	MOVE	T1,[-1]	;ADDED WITH [325]
	CAMN	T1,NDEV		;HAS NDEV BEEN MODIFIED?
	JRST	SWESW		;NO.
	TYPEIT	(/NDEV:)		;YES, LIST THIS SWITCH.
	MOVE	T1,NDEV		;GET WHAT THE USER TYPED.
	PUSHJ	P,.TSIXN	;AND OUTPUT IT.
SWESW:	MOVEI	T1,SWEDEF
	CAMN	T1,SWE		;HAS DEFAULT BEEN USED?
	JRST	SRESW		;IT IS DEFAULT, USER DIDN'T SPECIFY.
	TYPEIT	(/SWE:)		;IT'S BEEN CHANGED.
	MOVE	T1,SWE
	PUSHJ	P,.ODECW	;OUTPUT VALUE TYPED.
SRESW:	MOVEI	T1,SREDEF
	CAMN	T1,SRE		;IS SRE DEFAULT?
	JRST	IDSW		;YES
	TYPEIT	(/SRE:)		;NO, USER USED IT
	MOVE 	T1,SRE
	PUSHJ	P,.ODECW	;DUMP ITS VALUE.
IDSW:	MOVE	T1,[-1]
	CAMN	T1,ID		;USER MODIFY ID?
	JRST	DETSW		;NOPE
	TYPEIT	(/ID:)
	MOVE	T1,ID		;YES, SAY SO
	PUSHJ	P,.TSIXN
DETSW:	TLNN	F,F.DET		;SAID /DETAIL?
	 JRST	TRYSW		;NO
	TYPEIT	(/DETAIL:)	;YES SAYSO
TRYSW:	TLNN	F,F.TRY		;SAID /RETRY?
	 JRST	BEGCHK		;NO
	TYPEIT	(/RETRY:)	;YES
	MOVE	T1,RETRY
	PUSHJ	P,.ODECW	;ALL PART OF EDIT 126

BEGCHK:	SKIPGE	P4,BEGIN	;DID USER TYPE /BEGIN?
	JRST	ENDCHK		;NO
	TYPEIT	< /BEGIN: >
	MOVE	T1,P4		;PICKUP DATE USER TYPED
	PUSHJ	P,TYPNBS	;TYPE DECODED VALUE

ENDCHK:	SKIPGE	P4,END		;DID HE SAY /END
	JRST	FSTDAT
	TYPEIT	< /END: >
	MOVE	T1,P4		;PICKUP WHAT USER TYPED FOR END DATE
	PUSHJ	P,TYPNBS
FSTDAT:	TYPEIT	<
	DATE OF FIRST ENTRY PROCESSED:	>
	SKIPE	TOPMON	;TOPS20 RUNNING?
	 JRST	FSTDA1	;YES
	MOVE	T1,FILEST
	PUSHJ	P,TYPNBS
	JRST	FSTDA2		;GO AROUND TOPS20
FSTDA1:	HRROI	T1,DATLOC	;WHERE TO STORE IT
	HRLZI	T3,202100	;FORMAT FOR OUTPUT
	MOVE	T2,FILEST	;WHAT TO CONVERT
	ODTIM
	HRRZI	T1,DATLOC	
	PUSHJ	P,.TSTRG	;NOW LIST IT
FSTDA2:	TYPEIT	<
	DATE OF LAST ENTRY PROCESSED:	>
	SKIPE	TOPMON	;TOPS20 RUNNING?
	 JRST	FSTDA3	;YES
	MOVE	T1,FILEND
	PUSHJ	P,TYPNBS
	JRST	FSTDA4		;GO AROUND TOPS20
FSTDA3:	HRROI	T1,DATLOC	;WHERE TO STORE IT
	HRLZI	T3,202100	;FORMAT FOR OUTPUT
	MOVE	T2,FILEND	;WHAT TO CONVERT
	ODTIM
	HRRZI	T1,DATLOC	
	PUSHJ	P,.TSTRG	;NOW LIST IT
	;[223]
FSTDA4:	TYPEIT	<
	# OF INCONSISTENCIES DETECTED IN ERROR FILE:	>
	MOVE	T1,FILCNT
	PUSHJ	P,.ODECW	;IN DECIMAL
	;END 223
	POPJ	P,

TYPSWT:	TYPEIT	</>
	MOVE	T1,SWTABN(P4)
	PUSHJ	P,.TSIXN
	POPJ	P,
		;A SHORT ROUTINE TO OUTPUT CREATION DATE/TIME
		;OF A FILE WITH A SHORT LOOKUP. NOTE THAT
		;FILDAT WAS USED BUT IS NOT WHAT SOMEONE ELSE

			;****EDIT 107****

	;EXTFIL -- CALLED BY ENVLST TO LIST OTHER INPUT FILES
	; SUCH AS ERROR.X01 THRU ERROR.X77 IF THEY WERE READ.

EXTFIL:	MOVEI	P4,1		;INIT PASS COUNTER
	HRLZI	T1,'X00'		;FIRST EXTENSION
	MOVEM	T1,I.EXT		;SETUP
	SKIPN	P3,FILDAT(P4)		;NEXT FILDAT = 0?
	 POPJ	P,0			;YES-THATS ALL
	HLRZ	T1,I.EXT		;GET LAST EXT
	ADDI	T1,1
	TRNN	T1,7			;SIXBIT CARRY
	ADDI	T1,100-10		;FIX IT
	HRLZM	T1,I.EXT		;PUT IT BACK
	TYPEIT	<
		>
	MOVEI	T1,I.ST			;SETUP
	PUSHJ	P,.TFBLK		;LIST
	TYPEIT	<  CREATED >
	MOVE	T1,FILDAT(P4)		;GET CREATION DATE
	PUSHJ	P,TYPNBS		;LIST IT TOO
	AOJA	P4,EXTFIL+3		;BUMP & TRY NEXT
		;MIGHT EXPECT.!!
SHRTDT:	TYPEIT	<  CREATED: >
	HLRZ	T1,FILDAT	;GET DATE PORTION.
	PUSHJ	P,.TDATE	;OUTPUT IT
	JRST	ENVCON		;NOW GO DO THE REST.

	;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
	;HERE LIES THE ROUTINES TO DO ACTUAL SUMMARY OUTPUT

	SALL
	;SMLXXX -- SUBROUTINES TO LIST SUMMARY DATUM
	;CALL	PUSHJ	P,@SUMDSP(ERROR CODE)
	;
	;RETURN	CALL+1

SML1:	SKIPN	RLDWHY		;EDIT #106 SKIP IF NO RELOADS
	 POPJ	P,0		;DON'T BOTHER
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF		;SOME SPACE
	MOVE	T1,TYPMES(P4)	;GET HEADER TEXT
	PUSHJ	P,.TSTRG
	TYPEIT	<
	RELOAD BREAKDOWN:>	;WHAT WE'RE DOING
	MOVEI	P3,RLDWHY		;POINTER
	
RLDNXT:	HLRZ	P3,(P3)	;GET NEXT POINTER
	JUMPE	P3,.POPJ##	;ALL DONE
	MOVEI	P1,[ASCIZ\
		\]		;ONE PER LINE
	MOVE	P2,1(P3)	;GET REASON
	PUSHJ	P,.SIXBT	;PUBLISH
	MOVEI	P1,[ASCIZ\	\]	;SPACE OVER
	HRRZ	P2,(P3)		;GET COUNT
	PUSHJ	P,.DECML	;GET IT IN PRINT
	JRST	RLDNXT		;AND GET NEXT
SML2:	SKIPN	MSEWHY		;EDIT #113 SKIP IF NO STOPCD'S
	 POPJ	P,0		;DON'T BOTHER
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF		;SOME SPACE
	MOVE	T1,TYPMES(P4)	;GET HEADER TEXT
	PUSHJ	P,.TSTRG
	TYPEIT	<
	STOPCD BREAKDOWN:>	;WHAT WE'RE DOING
	TYPEIT	<
	TOTAL # OF DEBUG STOPCD'S:	>
	MOVE	T1,NDSPER	;GET THAT NUMBER
	PUSHJ	P,.ODECW	;WITH A .
	TYPEIT	<
	TOTAL # OF JOB STOPCD'S:	>
	MOVE	T1,NJSPER	;THATONE TOO
	PUSHJ	P,.ODECW
	MOVEI	P3,MSEWHY		;POINTER
	
MSENXT:	HLRZ	P3,(P3)	;GET NEXT POINTER
	JUMPE	P3,.POPJ##	;ALL DONE
	MOVEI	P1,[ASCIZ\
		\]		;ONE PER LINE
	MOVE	P2,1(P3)	;GET REASON
	PUSHJ	P,.SIXBT	;PUBLISH
	MOVEI	P1,[ASCIZ\	\]	;SPACE OVER
	HRRZ	P2,(P3)		;GET COUNT
	PUSHJ	P,.DECML	;GET IT IN PRINT
	JRST	MSENXT		;AND GET NEXT
SML3:	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	MOVE	T1,TYPMES(P4)	;PICKUP ERROR HEADER MESSAGE
	PUSHJ	P,.TSTRG
	TYPEIT	<
	REPRODUCIBLE:		>
	MOVE	T1,TPEPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	NON-REPRODUCIBLE:	>
	MOVE	T1,SPEPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	USER-ENABLED:		>
	MOVE	T1,UEPPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	DETECTED BY DATA
	 CHANNEL BUT NOT
	 SEEN BY CPU:		>
	MOVE	T1,PCSPER
	PUSHJ	P,.ODECW
	POPJ	P,

SML4:	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	MOVE	T1,TYPMES(P4)	;PICKUP ERROR HEADER MESSAGE
	PUSHJ	P,.TSTRG
	TYPEIT	<
	REPRODUCIBLE:		>
	MOVE	T1,TNEPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	NON-REPRODUCIBLE:	>
	MOVE	T1,SNEPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	USER-ENABLED:		>
	MOVE	T1,NUEPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	DETECTED BY DATA
	 CHANNEL BUT NOT
	 SEEN BY CPU:		>
	MOVE	T1,NCSPER
	PUSHJ	P,.ODECW
	POPJ	P,


SML6:	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	MOVE	T1,TYPMES(P4)	;PICKUP HEADER TEXT
	PUSHJ	P,.TSTRG
	TYPEIT	<
	NXM'S OR OVERRUNS
	 SEEN BY CHANNEL:	>
	MOVE	T1,NXMPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	MEM PE SEEN BY CHANNEL:	>
	MOVE	T1,MPEPER
	PUSHJ	P,.ODECW
	TYPEIT	<
	CONTROLLER DATA PE
	OR CCW TERM CHK FAILURES:	>
	MOVE	T1,DPEPER
	PUSHJ	P,.ODECW
	POPJ	P,

SML5:
SML17:
SML71:
SML7:
SML60:	POPJ	P,0
SML31:
SML61:	POPJ	P,0

SML10:	 	HRRZI	P1,-NUMRPB	;START SETUP
	HRLZI	P2,-DPANUM-DPBNUM	;CHECK 16
	HRRI	P2,DPALOC		;START HERE
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 JRST	SL10.1			;CHECK DPC'S
	PUSHJ	P,RPTITL	;PRINT RP10 CONTROLLER HEADER
	MOVSI	P2,-NUMRPB	;PICKUP COUNT OF NUMBER OF ENTRIES
	MOVE	P3,[XWD -DPANUM-DPBNUM,DPALOC]
	PUSHJ	P,DEVSUM	;GO PUBLISH RP TOTALS FOR CONTROLLER A
SL10.1:	HRRZI	P1,-NUMRPB	;SETUP
	HRLZI	P2,-DPCNUM-dpdnum	;16 AGAIN
	HRRI	P2,DPCLOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST	;ANY TO DO
	 JRST	SL10.2		;NO-HOW ABOUT FHA'S
	PUSHJ	P,RPTITL	;GO PRINT SOMETHING NICE
	MOVSI	P2,-NUMRPB	;COUNT OF ENTRIES
	MOVE	P3,[XWD -DPCNUM-DPDNUM,DPCLOC]
	PUSHJ	P,DEVSUM	;GO PUBLISH THESE TOTALS
SL10.2:	HRRZI	P1,-NUMRCB
	HRLZI	P2,-FHANUM-FHBNUM	;16
	HRRI	P2,FHALOC		;STARTING HERE
	HRLZI	P3,DEVDSP		;CONTROLLER ENTRIES
	PUSHJ	P,CHKLST		;LIST?
	 JRST	SL10.3			;NO-TRY FHC'S
	PUSHJ	P,FHTITL	;GO PRINT FH TITLE.
	MOVSI	P2,-NUMRCB	;PICKUP COUNT OF NUMBER OF RC ENTRIES/BLOCK
	MOVE	P3,[XWD -FHANUM-FHBNUM,FHALOC]
	PUSHJ	P,DEVSUM
SL10.3:	HRRZI	P1,-NUMRCB
	HRLZI	P2,-FHCNUM-FHDNUM
	HRRI	P2,FHCLOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 JRST	SL10.4		;TRY FSA'S
	PUSHJ	P,FHTITL
	MOVSI	P2,-NUMRCB	;SETUP
	MOVE	P3,[XWD -FHCNUM-FHDNUM,FHCLOC]
	PUSHJ	P,DEVSUM
SL10.4:	SKIPE	MASONE		;ANY CODE 11 ENTRIES?
	 POPJ	P,0		;YES-LIST SEPARATELY
	HRRZI	P1,-NUMRHB
	HRLZI	P2,-FSANUM-FSBNUM
	HRRI	P2,FSALOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 JRST	SL10.5		;NOTHING TO LIST HERE
	PUSHJ	P,RHTITLE	;LIST RH10 HEADER
	MOVSI	P2,-NUMRHB	;COUNT OF ENTRIES.
	MOVE	P3,[XWD -FSANUM-FSBNUM,FSALOC]
	PUSHJ	P,DEVSUM
SL10.5:	HRRZI	P1,-NUMRHB
	HRLZI	P2,-FSCNUM-FSDNUM
	HRRI	P2,FSCLOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST	;ANYTHING THERE?
	 POPJ	P,0		;NO,WE'RE DONE
	PUSHJ	P,RHTITL
	MOVSI	P2,-NUMRHB
	MOVE	P3,[XWD -FSCNUM-FSDNUM,FSCLOC]
	PUSHJ	P,DEVSUM
	POPJ	P,0

SML11:		HRRZI	P1,-NUMRHB
	HRLZI	P2,-FSANUM-FSBNUM
	HRRI	P2,FSALOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST	;LIST HEADER?
	 JRST	SL11.1		;NO CHECK FSC'S
	PUSHJ	P,RHTITL	;NICE HEADER
	MOVSI	P2,-NUMRHB
	MOVE	P3,[XWD -FSANUM-FSBNUM,FSALOC]	;SETUP
	PUSHJ	P,DEVSUM	;CONTROLLER & SOFTWARE DETECTED
SL11.1:	HRRZI	P1,-NUMRHB	;SETUP FOR FSC'S
	HRLZI	P2,-FSCNUM-FSDNUM	;16 AS USUAL
	HRRI	P2,FSCLOC	;START HERE
	HRLZI	P3,DEVDSP	;WITH THIS TABLE
	PUSHJ	P,CHKLST
	 JRST 	SL11.2		;NO-GO CHECK RPA'S
	PUSHJ	P,RHTITL	;NEXT PAGE
	MOVSI	P2,-NUMRHB
	MOVE	P3,[XWD -FSCNUM-FSDNUM,FSCLOC]
	PUSHJ	P,DEVSUM
SL11.2:	HRRZI	P1,-NUMRHB	;NOW FOR RP04'S
	HRLZI	P2,-RPANUM-RPANUM	;16
	HRRI	P2,RPALOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST	;CHECK AGAIN
	 JRST	SL11.3
	PUSHJ	P,RHTITL	;FOR RP04'S
	MOVSI	P2,-NUMRHB
	MOVE	P3,[XWD -RPANUM-RPBNUM,RPALOC]
	PUSHJ	P,DEVSUM
SL11.3:	HRRZI	P1,-NUMRHB
	HRLZI	P2,-RPCNUM-RPDNUM
	HRRI	P2,RPCLOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 JRST	SL11.4		;NOTHING-START ON DEVICES
	PUSHJ	P,RHTITL	;4TH PAGE MAYBE
	MOVSI	P2,-NUMRHB
	MOVE	P3,[XWD -RPCNUM-RPDNUM,RPCLOC]
	PUSHJ	P,DEVSUM

	;NOW TO LIST DEVICE DETECTED ERROR SUMMARIES

SL11.4:	HRRZI	P1,-NURS02	;# OF COUNTERS
	HRLZI	P2,-FSANUM-FSBNUM
	HRRI	P2,0		;START AT ZERO
	HRRZI	P3,MASDSP	;DO MASSBUS TABLES
	PUSHJ	P,CHKLST
	 JRST	SL11.5		;NOTHING -CHECK FSC'S
	PUSHJ	P,RS4TTL	;FIRST FOR RS04'S
	MOVSI	P2,-NURS02	;# ENTRIES PER DEV
	MOVE	P3,[XWD -FSANUM-FSBNUM,0]	;# DEVS, WHERE TO START
	PUSHJ	P,MDESUM	;FOR THESE TYPES REGISTERS

SL11.5:	HRRZI	P1,-NURS02
	HRLZI	P2,-FSCNUM-FSDNUM
	HRRI	P2,FSANUM+FSBNUM	;START AT RIGHT PLACE
	HRRZI	P3,MASDSP
	PUSHJ	P,CHKLST	;CHECK
	 JRST	SL11.6		;BUT SOMEPLACE ELSE
	PUSHJ	P,RS4TTL
	MOVSI	P2,-NURS02
	MOVE	P3,[XWD -FSCNUM-FSDNUM,FSANUM+FSBNUM]
	PUSHJ	P,MDESUM

SL11.6:	HRRZI	P1,-NURP02-NURP10-NURP15
	HRLZI	P2,-RPANUM-RPBNUM
	HRRI	P2,FSXNUM	;START AFTER FSX'S
	HRRZI	P3,MASDSP
	PUSHJ	P,CHKLST
	 JRST	SL11.7		;GO CHECK RPC'S
	PUSHJ	P,RP4TTL	;I HOPE IT ALL FITS
	MOVSI	P2,-NURP02-NURP10-NURP15	;# PER DEV
	MOVE	P3,[XWD -RPANUM-RPBNUM,FSXNUM]
	PUSHJ	P,MDESUM

SL11.7:	HRRZI	P1,-NURP02-NURP10-NURP15
	HRLZI	P2,-RPCNUM-RPDNUM
	HRRI	P2,FSXNUM+RPANUM+RPBNUM	;OFFSET (I HOPE!)
	HRRZI	P3,MASDSP
	PUSHJ	P,CHKLST
	 POPJ	P,0	;THAT'S IT FOR NOW
	PUSHJ	P,RP4TTL	;G.T. 16 RP04'S ??
	MOVSI	P2,-NURP02-NURP10-NURP15
	MOVE	P3,[XWD -RPCNUM-RPDNUM,FSXNUM+RPANUM+RPBNUM]
	PUSHJ	P,MDESUM
	POPJ	P,0		;THAT'S ALL FOLKS!!
	;NOTHING FOR TU16'S YET

SML15:	POPJ	P,	;NOTHING TO DO
SML20:		SETOM	ONE020		;SEEN A CODE 20
	HRRZI	P1,-11
	HRLZI	P2,-MTANUM-MTBNUM
	HRRI	P2,MTALOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 JRST	SL20.1		;GO CHECK MTC&MTD
	PUSHJ	P,TMTITL	;GO PRINT TITLE
	MOVSI	P2,-11	;SETUP NUMBER OF ENTRIES
	MOVE	P3,[XWD -MTANUM-MTBNUM,MTALOC]
	PUSHJ	P,MAGLST	;OUTPUT TOTALS FOR MTA&MTB
SL20.1:	HRRZI	P1,-11
	HRLZI	P2,-MTCNUM-MTDNUM
	HRRI	P2,MTCLOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 POPJ	P,0		;THAT'S ALL
	PUSHJ	P,TMTITL
	MOVSI	P2,-11	;YUP
	MOVE	P3,[XWD -MTCNUM-MTDNUM,MTCLOC]
	PUSHJ	P,MAGLST	;HANDLE THESE TOO.
	POPJ	P,0		;MORE THAN 32, I QUIT.

SML30:	POPJ	P,0	;NOTHING FOR NOW
SML40:	POPJ	P,
SML41:	SKIPN	ONE020		;SUMMARY DONE ALREADY?
	 PJRST 	SML20		;NOT YET
	POPJ	P,		;DONT DO ANYTHING FOR NOW

	;HERE START THE SUMMARY LISTING ROUTINES FOR TOPS20

SML111:	HRRZI	P1,-NUMRHB		;RH10 IS GREATER THAN RH20
	HRLZI	P2,-MAXSDV		;# PER CHANNEL-START AT ZERO
	HRLZI	P3,DEVDS2
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 JRST	S111.A			;NO
	HLRZ	T2,M000T		;GET CONTROLLER TYPE
	MOVEI	T1,RH2TTL		;ASSUME RH20
	PUSHJ	P,0(T1)			;LIST TITLE
	MOVSI	P2,-NUMRHB
	HRLZI	P3,-MAXSDV		;START AT 0
	PUSHJ	P,DEVSU2
	;START SECOND CONTROLLER
S111.A:	HRRZI	P1,-NUMRHB		;RH10 G.T.RH20
	HRLZI	P2,-MAXSDV		;# PER CHANNEL-START AT ZERO
	HRRI	P2,MAXSDV		;START A 8
	HRLZI	P3,DEVDS2
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 JRST	S111.B			;NO
	HLRZ	T2,M000T+MAXSDV		;GET CONTROLLER TYPE
	MOVEI	T1,RH2TTL		;ASSUME RH20
	PUSHJ	P,0(T1)			;LIST TITLE
	MOVSI	P2,-NUMRHB
	HRLZI	P3,-MAXSDV		;START AT 0
	HRRI	P3,MAXSDV		;START AT 8
	PUSHJ	P,DEVSU2
S111.B:	HRRZI	P1,-NUMRHB		;RH10G.T.RH20
	HRLZI	P2,-MAXSDV		;# PER CHANNEL-START AT ZERO
	HRRI	P2,2*MAXSDV		;START A 16
	HRLZI	P3,DEVDS2
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 JRST	S111.C			;NO
	HLRZ	T2,M000T+2*MAXSDV		;GET CONTROLLER TYPE
	MOVEI	T1,RH2TTL		;ASSUME RH20
	PUSHJ	P,0(T1)			;LIST TITLE
	MOVSI	P2,-NUMRHB
	HRLZI	P3,-MAXSDV		;START AT 0
	HRRI	P3,2*MAXSDV		;START AT 16
	PUSHJ	P,DEVSU2
;4TH CHANNEL
S111.C:	HRRZI	P1,-NUMRHB		;RH10G.T.RH20
	HRLZI	P2,-MAXSDV		;# PER CHANNEL-START AT ZERO
	HRRI	P2,3*MAXSDV		;START A 24
	HRLZI	P3,DEVDS2
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 JRST	S111.D			;NO
	HLRZ	T2,M000T+3*MAXSDV		;GET CONTROLLER TYPE
	MOVEI	T1,RH2TTL		;ASSUME RH20
	PUSHJ	P,0(T1)			;LIST TITLE
	MOVSI	P2,-NUMRHB
	HRLZI	P3,-MAXSDV		;START AT 0
	HRRI	P3,3*MAXSDV		;START AT 24
	PUSHJ	P,DEVSU2
	;NOW DO DEVICE REGISTERS
S111.D:HRRZI	P1,-50			;ALL REGISTERS ARE THIS LONG
	HRLZI	P2,-MAXSDV		;# TO CHECK
	HRRI	P2,0
	HRRZI	P3,MASDS2		;START HERE
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 JRST	S111.E			;NONE TO LIST
	SETZ	T2,
	HRRZ	T1,M000T(T2)		;GET DEVICE TYPE
	SKIPN	T1
	 AOJA	T2,.-2
	CAIN	T1,1			;ARE THESE RP04'S
	 MOVEI	T2,RP4TTL
	CAIN	T1,2			;RSO4'S?
	 MOVEI	T2,RS4TTL
	CAIN	T1,3			;TU16'S?
	 MOVEI	T2,TU6TTL
	CAIN	T1,4			;TU45'S?
	 MOVEI	T2,TU6TTL
	CAIL	T1,5		;[317]RP05OR6?
	 MOVEI	T2,RP4TTL	;HEADER IS THE SAME
	PUSHJ	P,0(T2)			;LIST TITLE
	MOVSI	P2,-50			;# OF COUNTERS
	MOVE	P3,[XWD -MAXSDV,0]	;# & WHERE TO START
	PUSHJ	P,MDESU2		;GO LIST
S111.E:HRRZI	P1,-50			;ALL REGISTERS ARE THIS LONG
	HRLZI	P2,-MAXSDV		;# TO CHECK
	HRRI	P2,MAXSDV
	HRRZI	P3,MASDS2		;START HERE
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 JRST	S111.F			;NONE TO LIST
	SETZ	T2,
	HRRZ	T1,M000T+MAXSDV(T2)		;GET DEVICE TYPE
	SKIPN	T1
	AOJA	T2,.-2
	CAIN	T1,1			;ARE THESE RP04'S
	 MOVEI	T2,RP4TTL
	CAIN	T1,2			;RSO4'S?
	 MOVEI	T2,RS4TTL
	CAIN	T1,3			;TU16'S?
	 MOVEI	T2,TU6TTL
	CAIN	T1,4			;TU45'S?
	 MOVEI	T2,TU6TTL
	CAIL	T1,5		;[317]RP05OR6?
	 MOVEI	T2,RP4TTL	;HEADER IS THE SAME
	PUSHJ	P,0(T2)			;LIST TITLE
	MOVSI	P2,-50			;# OF COUNTERS
	MOVE	P3,[XWD -MAXSDV,MAXSDV]	;# & WHERE TO START
	PUSHJ	P,MDESU2		;GO LIST
S111.F:HRRZI	P1,-50			;ALL REGISTERS ARE THIS LONG
	HRLZI	P2,-MAXSDV		;# TO CHECK
	HRRI	P2,2*MAXSDV
	HRRZI	P3,MASDS2		;START HERE
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 JRST	S111.G			;NONE TO LIST
	SETZ	T2,
	HRRZ	T1,M000T+2*MAXSDV(T2)		;GET DEVICE TYPE
	SKIPN	T1
	AOJA	T2,.-2
	CAIN	T1,1			;ARE THESE RP04'S
	 MOVEI	T2,RP4TTL
	CAIN	T1,2			;RSO4'S?
	 MOVEI	T2,RS4TTL
	CAIN	T1,3			;TU16'S?
	 MOVEI	T2,TU6TTL
	CAIN	T1,4			;TU45'S?
	 MOVEI	T2,TU6TTL
	CAIL	T1,5		;[317]RP05OR6?
	 MOVEI	T2,RP4TTL	;HEADER IS THE SAME
	PUSHJ	P,0(T2)			;LIST TITLE
	MOVSI	P2,-50			;# OF COUNTERS
	MOVE	P3,[XWD -MAXSDV,2*MAXSDV]	;# & WHERE TO START
	PUSHJ	P,MDESU2		;GO LIST
S111.G:HRRZI	P1,-50			;ALL REGISTERS ARE THIS LONG
	HRLZI	P2,-MAXSDV		;# TO CHECK
	HRRI	P2,3*MAXSDV
	HRRZI	P3,MASDS2		;START HERE
	PUSHJ	P,CHKLS2		;ANY NEED LISTING?
	 POPJ	P,0			;NONE TO LIST
	SETZ	T2,
	HRRZ	T1,M000T+3*MAXSDV(T2)		;GET DEVICE TYPE
	SKIPN	T1
	AOJA	T2,.-2
	CAIN	T1,1			;ARE THESE RP04'S
	 MOVEI	T2,RP4TTL
	CAIN	T1,2			;RSO4'S?
	 MOVEI	T2,RS4TTL
	CAIN	T1,3			;TU16'S?
	 MOVEI	T2,TU6TTL
	CAIN	T1,4			;TU45'S?
	 MOVEI	T2,TU6TTL
	CAIL	T1,5		;[317]RP05OR6?
	 MOVEI	T2,RP4TTL	;HEADER IS THE SAME
	PUSHJ	P,0(T2)			;LIST TITLE
	MOVSI	P2,-50			;# OF COUNTERS
	MOVE	P3,[XWD -MAXSDV,3*MAXSDV]	;# & WHERE TO START
	PUSHJ	P,MDESU2		;GO LIST
	POPJ	P,0			;ALLDONE!

SML131:
SML101:
SML160:
SML161:
SML67:

SML50:	POPJ	P,0	;NOTHING TO LIST
SML102:	SKIPN	BG%WHY		;
	 POPJ	P,0		;DON'T BOTHER
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF		;SOME SPACE
	MOVE	T1,TYPMES(P4)	;GET HEADER TEXT
	PUSHJ	P,.TSTRG
	TYPEIT	<
	BUGHLT/BUGCHK BREAKDOWN:>	;WHAT WE'RE DOING
	MOVEI	P3,BG%WHY		;POINTER
	
BG%NXT:	HLRZ	P3,(P3)	;GET NEXT POINTER
	JUMPE	P3,.POPJ##	;ALL DONE
	MOVEI	P1,[ASCIZ\
		\]		;ONE PER LINE
	MOVE	P2,1(P3)	;GET REASON
	PUSHJ	P,.SIXBT	;PUBLISH
	MOVEI	P1,[ASCIZ\	\]	;SPACE OVER
	HRRZ	P2,(P3)		;GET COUNT
	PUSHJ	P,.DECML	;GET IT IN PRINT
	JRST	BG%NXT		;AND GET NEXT


SML21:		SETOM	ONE021		;SEEN A CODE 21
	HRRZI	P1,-11
	HRLZI	P2,-MTANUM-MTBNUM
	HRRI	P2,MTALOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 JRST	SL21.1		;GO CHECK MTC&MTD
	PUSHJ	P,TMPITL	;GO PRINT TITLE
	MOVSI	P2,-11	;SETUP NUMBER OF ENTRIES
	MOVE	P3,[XWD -MTANUM-MTBNUM,MTALOC]
	PUSHJ	P,MAGLST	;OUTPUT TOTALS FOR MTA&MTB
SL21.1:	HRRZI	P1,-11
	HRLZI	P2,-MTCNUM-MTDNUM
	HRRI	P2,MTCLOC
	HRLZI	P3,DEVDSP
	PUSHJ	P,CHKLST
	 POPJ	P,0		;THAT'S ALL
	PUSHJ	P,TMPITL
	MOVSI	P2,-11	;YUP
	MOVE	P3,[XWD -MTCNUM-MTDNUM,MTCLOC]
	PUSHJ	P,MAGLST	;HANDLE THESE TOO.

	;HERE LIST TU16/45 DEVICE SUMMARY
	HRRZI	P1,-NUT602	;#OF BITS
	HRLZI	P2,-MTANUM-MTBNUM	;#DEV TO CHECK
	HRRI	P2,FSXNUM+RPXNUM	;WHERE TOSTART
	HRRZI	P3,MASDSP
	PUSHJ	P,CHKLST	;ANYTHING TO LIST
	 JRST	SL21.2
	PUSHJ	P,TU6TTL	;LIST HEADER
	MOVSI	P2,-NUT602
	MOVE	P3,[XWD -MTANUM-MTBNUM,FSXNUM+RPXNUM]
	PUSHJ	P,MDESUM
SL21.2:	HRRZI	P1,-NUT602	;#OF BITS
	HRLZI	P2,-MTCNUM-MTDNUM	;#DEV TO CHECK
	HRRI	P2,FSXNUM+RPXNUM+MTANUM+MTBNUM	;WHERE TOSTART
	HRRZI	P3,MASDSP
	PUSHJ	P,CHKLST	;ANYTHING TO LIST
	 POPJ	P,0	;THAT'S ALL
	PUSHJ	P,TU6TTL	;LIST HEADER
	MOVSI	P2,-NUT602
	MOVE	P3,[XWD -MTCNUM-MTDNUM,FSXNUM+RPXNUM+MTANUM+MTBNUM]
	PUSHJ	P,MDESUM
	POPJ	P,0		;MORE THAN 32, I QUIT.

SML42:	SKIPN	ONE021		;SUMMARY DONE ALREADY?
	 PJRST 	SML21		;NOT YET
	POPJ	P,		;DONT DO ANYTHING FOR NOW

SML130:	PUSHJ	P,TTLST
	TYPEIT	<

	FRONT END DEVICE ERROR SUMMARY:
>
	HRLZI	P1,-11		;# TO CHECK

SML13A:	SKIPN	P2,NUM130(P1)	;CHECK A VALUE
	 JRST	SML13B		;EMPTY-GET NEXT
	PUSHJ	P,.TTABC
	MOVE	T1,FE$NAM(P1)	;A DEVICE NAME
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TCOLN
	PUSHJ	P,.TTABC
	MOVE	T1,P2		;# OF ERRORS
	PUSHJ	P,.ODECW	;WITH A PERIOD
	PUSHJ	P,.TCRLF
SML13B:	AOBJN	P1,SML13A	;GET NEXT
	HRLZI	P1,-5
SML13C:	SKIPN	P2,NUH130(P1)	;GET A VALUE
	 JRST	SML13D		;EMPTY - GET NEXT
	PUSHJ	P,.TTABC
	MOVE	T1,FEHNAM(P1)	;A DEVICE NAME
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TCOLN
	PUSHJ	P,.TTABC
	MOVE	T1,P2		;# OF ERRORS
	PUSHJ	P,.ODECW	;WITH A PERIOD
	PUSHJ	P,.TCRLF
SML13D:	AOBJN	P1,SML13C	;GET NEXT
	POPJ	P,0		;OR ELSE RETURN

FE$NAM:	0
	SIXBIT/CTY/
	SIXBIT/DL11C/
	SIXBIT/DH11/
	SIXBIT/DLSCAN/
	SIXBIT/LP20/
	SIXBIT/CD20/
	SIXBIT/CLOCK/
	SIXBIT/FE DEV/
	SIXBIT/UNK/

FEHNAM:	SIXBIT/KLCPU/
	SIXBIT/KLERR/
	SIXBIT/UNK/
	SIXBIT/UNK/
	SIXBIT/UNK/



TMTITL:	PUSHJ	P,TTLST	;OUTPUT TITLE HEADER.
	TYPEIT	<          - MAGTAPE SYSTEM ANALYSIS ->
	TYPEIT	<


	HARDWARE DETECTED ERRORS>
	TYPEIT	<

	     CTL  MEM       OVR  UNT   MP  READ		WDS>
	TYPEIT	<
	     PAR  PAR  NXM  RUN  HNG  ERR  ERR		READ

>
	POPJ	P,0

TMPITL:	PUSHJ	P,TTLST	;OUTPUT TITLE HEADER.
	TYPEIT	<          - MAGTAPE SYSTEM ANALYSIS ->
	TYPEIT	<


	HARDWARE DETECTED ERRORS>
	TYPEIT	<

	     CTL  MEM       OVR  UNT   MP  READ		CHARS>
	TYPEIT	<
	     PAR  PAR  NXM  RUN  HNG  ERR  ERR		READ

>
	POPJ	P,0



	;RPTITL -- SUBROUTINE TO PRINT HEADER FOR RP10 CONTROLLER SUMMARY
	;CALL	PUSHJ	P,RPTITL
	;
	;RETURN	CALL+1
	;MODIFIED WITH EDIT 313 FOR RH20 TOO

RHTITL:	PUSHJ	P,TTLST
	TYPEIT	<	- MASSBUS SYSTEM ANALYSIS>
	IFN RH1KON,<
	TYPEIT	<


			HARDWARE DETECTED (RH10)						SOFTWARE DETECTED>
	TYPEIT	<
	     CTL  ILL  SEL  MEM  CTL       BUS       CHN  OVR  DRE>
	TYPEIT	<  ILL  PS   CTL       SAT  RIB  CHK  SEK  XFR  XFR  SEK  SFT  CWF
	     EXC  FUN  RAE  PAR  PAR  NXM  PAR  EXC  ERR  RUN  ERR>
	TYPEIT	<  CMD  FAL  OVR  RAE  ERR  ERR  ERR  INC  HG1  HG2  HNG  HNG  ERR

>
	>;END RH1KON
	IFN RH2KON,<
	TYPEIT	<

			HARDWARE DETECTED (RH20)						SOFTWARE DETECTED>
	TYPEIT	<
	     PAR       LWC  SWC  CHN  RES            OVR>
	TYPEIT	<                                SAT  RIB  CHK  SEK  XFR  XFR  SEK  SFT  CWF>
	TYPEIT	<
	     ERR  EXC  ERR  ERR  ERR  ERR  RAE  CNR  RUN>
	TYPEIT	<                                ERR  ERR  ERR  INC  HG1  HG2  HNG  HNG  ERR>
	>;END RH2KON

	PUSHJ	P,.TCRLF
	POPJ	P,0

RH2TTL:	PUSHJ	P,TTLST
	TYPEIT	<	- MASSBUS SYSTEM ANALYSIS(RH20)>
	TYPEIT	<


			HARDWARE DETECTED>
	TYPEIT	<
	     PAR       LWC  SWC  CHN  RES            OVR>
	TYPEIT	<
	     ERR  EXC  ERR  ERR  ERR  ERR  RAE  CNR  RUN>

	PUSHJ	P,.TCRLF
	POPJ	P,0


RPTITL:	PUSHJ	P,TTLST	;OUTPUT TITLE PAGE
	TYPEIT	<	- MOVABLE HEAD SYSTEM ANALYSIS>
	TYPEIT	<


				HARDWARE-DETECTED					SOFTWARE-DETECTED>
	TYPEIT	<

	     CTL  SEC  MEM  WRD  PWR  SRH  OVR       NOT  ILL>
	TYPEIT	<  ILL  SEC  SUR  SAT  RIB  CHK  SEK  XFR  XFR  SEK  SFT  CWF
             PAR  PAR  PAR  PAR  FAL  ERR  RUN  NXM  RDY  WRT>
	TYPEIT	<  DTO  ADD  ADD  ERR  ERR  ERR  INC  HG1  HG2  HNG  HNG  ERR

>
	POPJ	P,


FHTITL:	PUSHJ	P,TTLST
	TYPEIT	<	- FIXED HEAD SYSTEM ANALYSIS>
	TYPEIT	<


				HARDWARE-DETECTED				SOFTWARE-DETECTED>
	TYPEIT	<

             SRH  DUL  ILL  NOT  PWR  SEC  MEM  CTL       ILL>
	TYPEIT	<  OVR  SAT  RIB  CHK  SEK  XFR  XFR  SEK  SFT  CWF
             ERR  SEL  BCD  RDY  FAL  PAR  PAR  PAR  NXM  WRT>
	TYPEIT	<  RUN  ERR  ERR  ERR  INC  HG1  HG2  HNG  HNG  ERR

>
	POPJ	P,0



RS4TTL:	PUSHJ	P,TTLST
	TYPEIT	<	-RS04 DEVICE ANALYSIS>
	TYPEIT	<
	ERROR TOTALS DETECTED BY DEVICE


>
	TYPEIT	<        D  U  O  D  W  I  A  P  R  I  I>
	TYPEIT	<
        C  N  P  T  L  A  O  A  M  L  L
        K  S  I  E  E  E  E  R  R  R  F

>
	POPJ	P,0	;SHOULD WORK

TU6TTL:	PUSHJ	P,TTLST
	TYPEIT	<	-TU16 & TU45 DEVICE ANALYSIS>
	TYPEIT	<
	ERROR TOTALS DETECTED BY DEVICE

>
	TYPEIT	<
       CC  U  O  D  N  I  F  N PL IV  D  F  P  R  I  I>
	TYPEIT	<
       OR  N  P  T  E CF  C  S ER NP  P  M  A  M  L  L>
	TYPEIT	<
       RC  S  I  E  F SM  E  G FC CE  A  T  R  R  R  F>
TYPEIT	<
                                      R

>
	POPJ	P,0



	;RP4TTL- NEEDS 132 COLUMN LPT TO WORK AS PLANNED

RP4TTL:	PUSHJ	P,TTLST
	TYPEIT	<	-RP04 (* RP05, RP06) DEVICE ANALYSIS>
	TYPEIT	<

	ERROR TOTALS DETECTED BY DEVICE


                 - ERROR REG. #1 -                               - ERROR REG. #2 -                     - ERROR REG. #3 ->
	TYPEIT	<
									      *        *                          *     *  *>
	TYPEIT	<
        D  U  O  D  W  I  A  H  H  E  W  F  P  R  I  I *A  P  3  I  N>
	TYPEIT	<  M  W  FA T  T  MR C  W  C  W *O  S  D  A  D3 U  VW PD>
	TYPEIT	<                C  N  P  T  L  A  O  C  C  C  C  E  A  M  L  L>
	TYPEIT	< *C  L  0  X  H  H  R  EB U  D  S& S  S  S  C *C  K  C  C  I5 W  UO SC>
	TYPEIT	<
        K  S  I  E  E  E  E  R  E  H  F  R  R  R  R  F *U  U  V  E  S>
	TYPEIT	<  S  U  NS F  F  EW U  U  F  U *Y  I  L  L  SV R  FF UU
                             C>
	TYPEIT	<                         *         U                                  *L
>
	POPJ	P,0	;IF THAT WORKS I'M SURPRISED.

        	;DEVSUM -- SUBROUTINE TO OUTPUT DEVICE ERROR COUNTS
	;SETUP	P2= -# OF WORDS IN BLOCK TO TYPEOUT
	;	P3= XWD -#DEVICES,OFFSET WITH RESPECT TO NAMTBL OF DEVICE TYPE
	;CALL	PUSHJ	P,DEVSUM


DEVSUM:	HRRZ	P1,DEVDSP(P3)	;CHECK FOR SOFT ERRORS FIRST
	HLL	P1,P2		;-WCTO LEFT
	SKIPE	0(P1)		;IS COUNT 0?
	 JRST	DEVSU1		;NO LIST
	AOBJN	P1,.-2		;YES-BUMP COUNT
	HLRZ	P1,DEVDSP(P3)	;SETTUP AGAIN FOR HARD ERRORS
	HLL	P1,P2
	SKIPE	0(P1)		;HARD ERROR?
	 JRST	DEVSU1		;LIST
	AOBJN	P1,.-2		;TRY NEXT COUNTER
	MOVSI	P1,-NUMSFB	;HOW ABOUT SOFTWARE DETECTED
	HRR	P1,SOFDSP(P3)
	SKIPE	0(P1)		;ANY COUNTS?
	 JRST	DEVSU1		;YES
	AOBJN	P1,.-2		;TRY AGAIN
	AOBJN	P3,DEVSUM	;TRY NEXT DEVICE
	POPJ	P,0		;ALL DONE GO HOME
DEVSU1:	MOVE	T1,NAMTBL(P3)	;PICKUP DEVICE NAME
	PUSHJ	P,.TSIXN	;TYPE IT IN SIXBIT
	TYPEIT	< HARD  >
	HLRZ	P1,DEVDSP(P3)	;PICKUP ADDRESS OF HARD ERROR BLOCK
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,TYPCNT	;PUBLISH IT
	MOVSI	P1,-NUMSFB	;PICKUP SOFTWARE DETECTED ERR COUNT
	HRR	P1,SOFDSP(P3)	;PICKUP ADDRESS OF SOFT-DET ERROR BLOCK
	PUSHJ	P,TYPCNT
	TYPEIT	<
     SOFT  >
	HRRZ	P1,DEVDSP(P3)
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,TYPCNT
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	AOBJN	P3,DEVSUM
	POPJ	P,
        	;DEVSU2 -- SUBROUTINE TO OUTPUT DEVICE ERROR COUNTS
	;SETUP	P2= -# OF WORDS IN BLOCK TO TYPEOUT
	;	P3= XWD -#DEVICES,OFFSET WITH RESPECT TO NAMTB2 OF DEVICE TYPE
	;CALL	PUSHJ	P,DEVSU2


DEVSU2:	HRRZ	P1,DEVDS2(P3)	;CHECK FOR SOFT ERRORS FIRST
	HLL	P1,P2		;-WCTO LEFT
	SKIPE	0(P1)		;IS COUNT 0?
	 JRST	DEVS21		;NO LIST
	AOBJN	P1,.-2		;YES-BUMP COUNT
	HLRZ	P1,DEVDS2(P3)	;SETTUP AGAIN FOR HARD ERRORS
	HLL	P1,P2
	SKIPE	0(P1)		;HARD ERROR?
	 JRST	DEVS21		;NO LIST
	AOBJN	P1,.-2		;TRY NEXT COUNTER
	MOVSI	P1,-NUMSFB	;HOW ABOUT SOFTWARE DETECTED
	HRR	P1,SOFDS2(P3)
	SKIPE	0(P1)		;ANY COUNTS?
	 JRST	DEVS21		;NO LIST
	AOBJN	P1,.-2		;TRY AGAIN
	AOBJN	P3,DEVSU2	;TRY NEXT DEVICE
	POPJ	P,0		;ALL DONE GO HOME
DEVS21:	MOVE	T1,NAMTB2(P3)	;PICKUP DEVICE NAME
	PUSHJ	P,FIXMAN		;GO CONVERT THAT NAME
	PUSHJ	P,.TSIXN	;TYPE IT IN SIXBIT
	TYPEIT	< HARD  >
	HLRZ	P1,DEVDS2(P3)	;PICKUP ADDRESS OF HARD ERROR BLOCK
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,TYPCNT	;PUBLISH IT
	MOVSI	P1,-NUMSFB	;PICKUP SOFTWARE DETECTED ERR COUNT
	HRR	P1,SOFDS2(P3)	;PICKUP ADDRESS OF SOFT-DET ERROR BLOCK
	PUSHJ	P,TYPCNT
	TYPEIT	<
      SOFT  >
	HRRZ	P1,DEVDS2(P3)
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,TYPCNT
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	AOBJN	P3,DEVSU2
	POPJ	P,

       	;MAGLST -- SUBROUTINE TO OUTPUT MAGTAPE ERROR COUNTS
	;SETUP	P2= -# OF WORDS IN BLOCK TO TYPEOUT
	;	P3= XWD -#DEVICES,OFFSET WITH RESPECT TO NAMTBL OF DEVICE TYPE
	;CALL	PUSHJ	P,MAGLST


MAGLST:	HRRZ	P1,DEVDSP(P3)	;CHECK FOR SOFT ERRORS FIRST
	HLL	P1,P2		;-WCTO LEFT
	SKIPE	0(P1)		;IS COUNT 0?
	 JRST	MAGLS1		;NO LIST
	AOBJN	P1,.-2		;YES-BUMP COUNT
	HLRZ	P1,DEVDSP(P3)	;SETTUP AGAIN FOR HARD ERRORS
	HLL	P1,P2
	SKIPE	0(P1)		;HARD ERROR?
	 JRST	MAGLS1		;LIST
	AOBJN	P1,.-2		;TRY NEXT COUNTER
	MOVSI	P1,-NUMSFB	;HOW ABOUT SOFTWARE DETECTED
	HRR	P1,SOFDSP(P3)
	SKIPE	0(P1)		;ANY COUNTS?
	 JRST	MAGLS1		;YES
	AOBJN	P1,.-2		;TRY AGAIN
	AOBJN	P3,MAGLST	;TRY NEXT DEVICE
	POPJ	P,0		;ALL DONE GO HOME
MAGLS1:	MOVE	T1,NAMTBL(P3)	;PICKUP DEVICE NAME
	PUSHJ	P,.TSIXN	;TYPE IT IN SIXBIT
	TYPEIT	<  HARD  >
	HLRZ	P1,DEVDSP(P3)	;PICKUP ADDRESS OF HARD ERROR BLOCK
	HRLI	P1,-7		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,TYPCNT	;PUBLISH IT
	PUSHJ	P,.TTABC
	PUSHJ	P,.TTABC
	MOVE	T1,0(P1)	;# MILLION WORDS READ
	PUSHJ	P,.ODECW	;DUMP W A "."
	PUSHJ	P,.MOUT		;DUMP PART OF MILLION
	TYPEIT	< MILLION>
	TYPEIT	<
      SOFT  >
	HRRZ	P1,DEVDSP(P3)
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,TYPCNT
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	AOBJN	P3,MAGLST
	POPJ	P,

	;.MOUT -- ROUTINE TO DUMP FRACTIONAL PART OF A MILLION
	;WORDS READ

.MOUT:	PUSHJ	P,.SAVE4	;SAVE P1-P4
	MOVE	P1,1(P1)
	SETZ	P3,
	PUSHJ	P,CNVRT
	POPJ	P,0		;ALSO RETURNS P1-P4

CNVRT:	AOS	,P3
	IDIVI	P1,^D10
	HRLM	P2,0(P)		;SAVE REMAINDER ON STACK
	SKIPE	,P1
	PUSHJ	P,CNVRT		;SOME MORE
	CAIN	P3,6		;DUMP LEADING ZEROS
	JRST .+4
	TYPEIT	<0>
	AOJA	P3,.-4
	HLRZ	T1,0(P)		;NOW GET NUMBERS TO PRINT
	ADDI	T1,"0"
	PUSHJ	P,.TCHAR	;DUMP IT
	POPJ	P,0		;ONE OF THESE WILL GET US BACK TO
				;.MOUT AFTER ALL NUMBERS ARE TYPED


	;FIXNAM-ROUTINE TO CHANGE MASSBUS DEVICE NAMES FROM 'MXXX' TO
	;	'DPXXX' OR 'MTXXX'.
	;	TI HAS 'MXXX'
	;	P3 HAS INDEX

FIXMAN:	LSH	T1,-6		;SHIFT RIGHT 1 SIXBIT CHAR
	HRRZ	T2,M000T(P3)	;GET DEVICE TYPE
	MOVEI	T3,'DP'	;ASSUME RP04,5,OR6DP'
	CAIN	T2,2			;RS04?
	 MOVEI	T3,'FS'
	CAIN	T2,3			;TU16?
	 MOVEI	T3,'MT'
	CAIN	T2,4			;TU45?
	 MOVEI	T3,'MT'
	SKIPE	T3		;IF 0 DONT CHANGE
	DPB	T3,[POINT 12,T1,11]	;CHANGE MANE
	POPJ	P,0
	;MDESUM -- SUBROUTINE TO OUTPUT DEVICE ERROR COUNTS
	;FOR MASSBUS DEVICE ERROR REGISTERS
	;SETUP	P2= -# OF WORDS IN BLOCK TO TYPEOUT
	;	P3= XWD -#DEVICES,OFFSET WITH RESPECT TO MASNAM TABLE OF DEVICE TYPE
	;CALL	PUSHJ	P,MDESUM


MDESUM:	HRRZ	P1,MASDSP(P3)	;CHECK FOR SOFT ERRORS FIRST
	HLL	P1,P2		;-WC TO LEFT
	SKIPE	0(P1)		;IS COUNT 0?
	 JRST	MDESU1		;NO LIST
	AOBJN	P1,.-2		;YES-BUMP COUNT
	HLRZ	P1,MASDSP(P3)	;SETTUP AGAIN FOR HARD ERRORS
	HLL	P1,P2
	SKIPE	0(P1)		;HARD ERROR?
	 JRST	MDESU1		;LIST
	AOBJN	P1,.-2		;TRY NEXT COUNTER
	AOBJN	P3,MDESUM	;TRY NEXT DEVICE
	POPJ	P,0		;ALL DONE GO HOME
MDESU1:	MOVE	T1,MASNAM(P3)	;PICKUP DEVICE NAME
	PUSHJ	P,.TSIXN	;TYPE IT IN SIXBIT
	TYPEIT	< H >
	HRRZ	P1,MASDSP(P3)	;PICKUP ADDRESS OF HARD ERROR BLOCK
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,MASCNT	;PUBLISH IT
	TYPEIT	<
     S >
	HLRZ	P1,MASDSP(P3)
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,MASCNT
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	AOBJN	P3,MDESUM
	POPJ	P,


	;chklst--subroutine to check dev  counters to see if
	;any need listing. similar to 1st part of devsum
	;setup	p1 = -# words(counters) per dev to check
	;	p2 = -# devs to check,,offset to 1st
	;	p3 = lh--devdsp or 0
	;	     rh--masdsp or 0
	;		if lh not = 0, sofdsp will also be checked
	;call:	pushj	p,chklst
	;rtn:	+1 if no listing req'd
	;       +2 if listing is needed

chklst:	HLRZ	T1,P2		;GET # DEVICES TOCHECK
	SKIPN	T1		;IF NONE--EDIT 145
	 POPJ	P,0		;RETURN NOW
	hlrz	t1,p3		;get devdsp
	skipn	t1		;anything there
	 jrst	chkls1		;no try rh
	add	t1,p2		;build pointer for soft errors first
	HRLZ	T2,P1		;#COUNTERS
	HRR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST	SKPRTN		;NO-LIST
	AOBJN	T2,.-2		;CHECK NEXT COUNTER
	AOBJN	T1,CHKLST+7	;CHECK NEXT DEVICE
	HLRZ	T1,P3		;GETDEVDSP
	ADD	T1,P2		;NOW FOR HARD ERRORS
	HRLZ	T2,P1		;# COUNTERS
	HLR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST	SKPRTN		;NO
	AOBJN	T2,.-2
	AOBJN	T1,.-5
	HRRZI	T1,SOFDSP	;CHECK SOFTWARE DETECTED
	ADD	T1,P2		;OFFSETS
	HRLZI	T2,-NUMSFB	;# COUNTERS
	HLR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST	SKPRTN
	AOBJN	T2,.-2		;NEXT COUNTER
	AOBJN	T1,.-5		;NEXT DEVICE
	
	;FALL INTO MASSBUS CHECKERS
	
CHKLS1:	HRRZ	T1,P3		;GET MASDSP
	SKIPN	T1
	 POPJ	P,0	;LEAVE
	ADD	T1,P2		;# DEVS,OFFSET
	HRLZ	T2,P1		;# COUNTERS
	HRR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)
	 JRST	SKPRTN
	AOBJN	T2,.-2
	AOBJN	T1,.-5		;CHECK NEXT DEVICE
	HRRZ	T1,P3		;NOW FOR HARD ERRORS
	ADD	T1,P2
	HRLZ	T2,P1		;# COUNTERS
	HLR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST SKPRTN		;NOPE
	AOBJN	T2,.-2		;CHECK NEST COUNTER
	AOBJN	T1,.-5		;CHECK NEXT DEVICE
	POPJ	P,0		;THATS ALL LEAVE


	;MDESU2 -- SUBROUTINE TO OUTPUT DEVICE ERROR COUNTS FOR TOPS20
	;FOR MASSBUS DEVICE ERROR REGISTERS
	;SETUP	P2= -# OF WORDS IN BLOCK TO TYPEOUT
	;	P3= XWD -#DEVICES,OFFSET WITH RESPECT TO MASNA2 TABLE OF DEVICE TYPE
	;CALL	PUSHJ	P,MDESU2


MDESU2:	HRRZ	P1,MASDS2(P3)	;CHECK FOR SOFT ERRORS FIRST
	HLL	P1,P2		;-WC TO LEFT
	SKIPE	0(P1)		;IS COUNT 0?
	 JRST	MDES21		;NO LIST
	AOBJN	P1,.-2		;YES-BUMP COUNT
	HLRZ	P1,MASDS2(P3)	;SETTUP AGAIN FOR HARD ERRORS
	HLL	P1,P2
	SKIPE	0(P1)		;HARD ERROR?
	 JRST	MDES21		;NO LIST
	AOBJN	P1,.-2		;TRY NEXT COUNTER
	AOBJN	P3,MDESU2	;TRY NEXT DEVICE
	POPJ	P,0		;ALL DONE GO HOME
MDES21:	MOVE	T1,MASNA2(P3)	;PICKUP DEVICE NAME
	PUSHJ	P,FIXMAN		;CHANGE IT
	PUSHJ	P,.TSIXN	;TYPE IT IN SIXBIT
	TYPEIT	< H>
	HRRZ	P1,MASDS2(P3)	;PICKUP ADDRESS OF HARD ERROR BLOCK
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,MASCNT	;PUBLISH IT
	TYPEIT	<
      S>
	HLRZ	P1,MASDS2(P3)
	HLL	P1,P2		;PUT -WORDCOUNT IN LH OF P1
	PUSHJ	P,MASCNT
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	AOBJN	P3,MDESU2
	POPJ	P,


	;chkLS2--subroutine to check dev  counters to see if
	;any need listing. similar to 1st part of devsum
	;setup	p1 = -# words(counters) per dev to check
	;	p2 = -# devs to check,,offset to 1st
	;	p3 = lh--devdsp or 0
	;	     rh--masdsp or 0
	;		if lh not = 0, sofdsp will also be checked
	;call:	pushj	p,chklst
	;rtn:	+1 if no listing req'd
	;       +2 if listing is needed

chkLS2:	HLRZ	T1,P2		;GET # DEVICES TOCHECK
	SKIPN	T1		;IF NONE--EDIT 145
	 POPJ	P,0		;RETURN NOW
	hlrz	t1,p3		;get devdsp
	skipn	t1		;anything there
	 jrst	chkl21		;no try rh
	add	t1,p2		;build pointer for soft errors first
	HRLZ	T2,P1		;#COUNTERS
	HRR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST	SKPRTN		;NO-LIST
	AOBJN	T2,.-2		;CHECK NEXT COUNTER
	AOBJN	T1,CHKLS2+7	;CHECK NEXT DEVICE
	HLRZ	T1,P3		;GETDEVDSP
	ADD	T1,P2		;NOW FOR HARD ERRORS
	HRLZ	T2,P1		;# COUNTERS
	HLR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST	SKPRTN		;NO
	AOBJN	T2,.-2
	AOBJN	T1,.-5
	HRRZI	T1,SOFDS2	;CHECK SOFTWARE DETECTED
	ADD	T1,P2		;OFFSETS
	HRLZI	T2,-NUMSFB	;# COUNTERS
	HLR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST	SKPRTN
	AOBJN	T2,.-2		;NEXT COUNTER
	AOBJN	T1,.-5		;NEXT DEVICE
	
	;FALL INTO MASSBUS CHECKERS
	
CHKL21:	HRRZ	T1,P3		;GET MASDSP
	SKIPN	T1
	 POPJ	P,0	;LEAVE
	ADD	T1,P2		;# DEVS,OFFSET
	HRLZ	T2,P1		;# COUNTERS
	HRR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)
	 JRST	SKPRTN
	AOBJN	T2,.-2
	AOBJN	T1,.-5		;CHECK NEXT DEVICE
	HRRZ	T1,P3		;NOW FOR HARD ERRORS
	ADD	T1,P2
	HRLZ	T2,P1		;# COUNTERS
	HLR	T2,(T1)		;WHERE TO START
	SKIPE	(T2)		;= 0?
	 JRST SKPRTN		;NOPE
	AOBJN	T2,.-2		;CHECK NEST COUNTER
	AOBJN	T1,.-5		;CHECK NEXT DEVICE
	POPJ	P,0		;THATS ALL LEAVE



	;TYPCNT -- SUBROUTINE TO TYPE ERROR BLOCK COUNTS
	;SETUP	P1= -WORDCOUNT,START ADDRESS OF BLOCK TO TYPE
	;
	;CALL	PUSHJ	P,TYPCNT
	;RETURN CALL+1

TYPCNT:MOVE	T1,(P1)		;PICKUP WORD
	PUSHJ	P,TYPE4		;TYPE IT AS 5 CHARACTER DECIMAL DIGIT CHANGING 0'S TO SPACES
	MOVEI	T1,.TSPAC
	TLNE	F,F.SAWD	;# SEEN?
	 MOVEI	T1,.TPER	;YES
	PUSHJ	P,0(T1)	;TYPE EITHER SPACE OR PERIOD
	AOBJN	P1,TYPCNT	;LOOP TILL DONE
	POPJ	P,


	;MASCNT -- SUBROUTINE TO TYPE ERROR BLOCK COUNTS
	;SETUP	P1= -WORDCOUNT,START ADDRESS OF BLOCK TO TYPE
	;
	;CALL	PUSHJ	P,MASCNT
	;RETURN CALL+1

MASCNT:MOVE	T1,(P1)		;PICKUP WORD
	PUSHJ	P,TYPE2		;TYPE IT AS 3 CHARACTER DECIMAL DIGIT CHANGING 0'S TO SPACES
	MOVEI	T1,.TSPAC
	TLNE	F,F.SAWD	;# SEEN?
	 MOVEI	T1,.TPER	;YES
	PUSHJ	P,0(T1)	;TYPE EITHER SPACE OR PERIOD
	AOBJN	P1,MASCNT	;LOOP TILL DONE
	POPJ	P,0

	;TYPE4 -- SUBROUTINE TO TYPE 4 DIGIT DECIMAL NUMBER
	;CONVERTING LEADING ZEROS TO SPACES
	;CALL	PUSHJ	P,TYPE4

TYPE4:	MOVSI	T3,-4		;SETUP TO DO 4 DIGITS
	CAILE	T1,^D9999	;IS NUMBER TOO BIG TO TYPE IN 4 DIGITS
	MOVEI	T1,^D9999	;SAY IT WAS 9999
	TLZ	F,F.SAWD	;CLEAR BIT SAYING WE SAW A NON-ZERO DIGIT
DIVST:	IDIVI	T1,^D10
	HRLM	T2,(P)		;SAVE REMAINDER ON STACK
	AOBJP	T3,.+2
	PUSHJ	P,DIVST		;ITERATE
	HLRZ	T1,(P)		;PICKUP DIGIT
	TLNE	F,F.SAWD	;HAVE WE SEEN A NON-ZERO DIGIT YET?
	JRST	DIVST1		;YES- TYPE 0 AS 0 NOT SPACE
	CAIN	T1,0		;IS IT A ZERO
	MOVEI	T1,-20		;YES CHANGE IT TO SPACE
DIVST1:	ADDI	T1,60		;DO CONVERSION TO ASCII
	TLZ	T1,-1		;CLEAR THE LH PART OF WORD
	CAIE	T1,40		;IS THIS DIGIT SPACE THEREFORE A ZERO
	TLO	F,F.SAWD	;SAY WE SAY A DIGIT
	PJRST	.TCHAR		;TYPE IT AND LOOP TILL DONE


.TPER:	TYPEIT	<.>
	POPJ	P,0
	;TYPE2 -- SUBROUTINE TO TYPE 2 DIGIT DECIMAL NUMBER
	;CONVERTING LEADING ZEROS TO SPACES
	;CALL	PUSHJ	P,TYPE2

TYPE2:	MOVSI	T3,-2		;SETUP TO DO 2 DIGITS
	CAILE	T1,^D99		;IS NUMBER TOO BIG TO TYPE IN 2 DIGITS
	MOVEI	T1,^D99		;SAY IT WAS 99
	TLZ	F,F.SAWD	;CLEAR BIT SAYING WE SAW A NON-ZERO DIGIT
DIVST3:	IDIVI	T1,^D10
	HRLM	T2,(P)		;SAVE REMAINDER ON STACK
	AOBJP	T3,.+2
	PUSHJ	P,DIVST3		;ITERATE
	HLRZ	T1,(P)		;PICKUP DIGIT
	TLNE	F,F.SAWD	;HAVE WE SEEN A NON-ZERO DIGIT YET?
	JRST	DIVST4		;YES- TYPE 0 AS 0 NOT SPACE
	CAIN	T1,0		;IS IT A ZERO
	MOVEI	T1,-20		;YES CHANGE IT TO SPACE
DIVST4:	ADDI	T1,60		;DO CONVERSION TO ASCII
	TLZ	T1,-1		;CLEAR THE LH PART OF WORD
	CAIE	T1,40		;IS THIS DIGIT SPACE THEREFORE A ZERO
	TLO	F,F.SAWD	;SAY WE SAY A DIGIT
	PJRST	.TCHAR		;TYPE IT AND LOOP TILL DONE



PDLPNT:	IOWD	LPDL,PDLST	;INITIAL POINTER
	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 SETUP DEFAULTS

	DEFVAL

	;NOW MAKE SWTCHS MACRO FOR USE WITH DOSCAN

	DEFINE	SWTCHS<
	DUMCH1
	DUMCH2
	>

	DOSCAN(SWTAB)
	;GENERATE SIXBIT TABLE OF DEVICE NAMES

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

MASNAM:		DUMFS
	DUMRP
	DUMTM
	MASLTH=<.-1>-MASNAM+1	;LENGTH OF THIS TABLE

MASNA2::	DUMDVB

	MASLT2=<.-1>-MASNA2+1	;LENGTH OF THIS TABLE





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

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

SUMDSP:	DUMENT



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

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

DEVDSP:	DUMDVA

DEVDS2::	DUMDVB


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

	;NOW THE DISPATCHER FOR MASSBUS ERROR REGS

	DEFINE	DUMDV (A)<
	XWD	A'DS, A'DH
	>
MASDSP:		DUMFS
	DUMRP
	DUMTM

MASDS2:	DUMDVB


	;POINTERS TO TABLES OF DEVICE TYPES
	DEFINE	DUMDV	(A)<
	XWD	0,A'T
	>
BKLOC:	DUMDVB


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

ALLTBL:	DUMENT

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



	;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)<
	[ASCIZ/B/]
>


	;GENERATE THE TEXT


TYPMES:	DUMENT
	LIST

	END	START