Google
 

Trailing-Edge - PDP-10 Archives - BB-D868C-BM - language-sources/syserd.mac
There are 16 other files named syserd.mac in the archive. Click here to see a list.
	TITLE	SYSERD -- SYSTEM ERROR FILE PROCESSOR -- MAINLINE CODE
	SUBTTL	VERSION 14(1270)	K. COYE/ RLD/ PJB/ ES/ TJW/ LWE/ SRL/ GSK





;COPYRIGHT (C) 1972,1975,1977,1978,1979 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

	.REQUIRE SYRLIB


	;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.

	DEFINE	DUMALL<
	DUM101
	DUM102
	DUM111
	DUM112
	DUM115			;[1204]
	DUM116
	DUM130
	DUM131
	DUM133			;[756]
	DUM160
	DUM161
	DUM162			; [614]
	DUM163			;[740]
	DUM164			;[1255]
>

	;EXTERNALS DEFINED HERE ARE IN SYRLIB.MAC, THE LIBRARY
	;OF COMMON ROUTINES FOR ALL PARTS OF THE SYSERR PACKAGE.
	; THIS TABLE CLEANED UP WITH EDIT  [1217]

	EXTERNAL ABORT,PTSTRG,BADNAM,DEVCHK,ERRINT,SKIPIT,IDCHK
	EXTERNAL STRCHK,DETCHK,DMPENT,HDRLST,CHROUT,MN2VER,SBUSFN
	EXTERNAL GETNBS,.OCTLE,.DECML,.ASCIE,.SIXBT,ENTRST,NOTRAN
	EXTERNAL .HAFWD,.SPECL,.ODECW,.UDATE,.TASCI,.PPNWT,.TDIRW
	EXTERNAL ACLST,SAVE4P,RET4P,HWDUMP,LSTEB,CNIDCD,R5VSIX
	EXTERNAL .MXBLK,.TRBLK,.SUBLK,.SECBK,TITLST,ADVBFF,NEWCMD
	EXTERNAL .TVERW,T11ACI,BLKTRN,DRVTYP,COLOUT,SBDOUT,DSERCD
	EXTERNAL FE.KLI,KR%ECD,FE%DEV,DUMPOS,DSKPOS,TAPPOS,GTBF00
	EXTERNAL REMDAT,BYTE.8,NDVCHK,.TYOCH,DYNSUM

	;INTERNALS DEFINED HERE ARE FOR USE BY SYRLIB

	INTERNAL KONMSK,MINERB,ALLTBL,PDLPNT
	INTERNAL TYPMES,LINE,ALLLTH,DUMDAY
	INTERNAL DEVTYP,ERINDX,PCSTBL,BITCHK,ERRLTH
	INTERNAL ERRTBL,MDE000,BLTTAB,FE$NAM
	INTERNAL MASLTH,NAMLTH
	.JBVER==137
	LOC	.JBVER

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


	TWOSEG
	RELOC	400000



;DUMMY LABELS FOR SYRLIB

MASLTH==0
NAMLTH==0

NAMTBL::
SUMUPD::
DEVDSP::
MASNAM::	Z		;GIVE IT SOME SPACE
	;PROCSD -- STANDARD ENTRY PROCESSOR #1
	;CALL	JRST PROCSD
	;
	;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

PROCSD:	TRNE	F,F.BRF		;/BRIEF ?  -  EDIT [724]
	 JRST	NEWCMD	;YES! - DO IT THAT WAY
	SETZM	OFFSET		;CLEAR WORD OFFSET COUNT
	MOVE	P1,(CTINDX)	;PICKUP FIRST WORD IN CONTROL TABLE
	JUMPE	P1,ABORT	;ABORT WHEN END OF CTL TABLE SEEN
	TLNE	P1,770000	;DO WE NEED TO GET AN AOB POINTER
	PUSHJ	P,GETAOB	;YES-WORD IS IN A RELOCATABLE SUBTABLE IN ENTRY
	LDB	T2,[POINT 6,P1,11]	;PICKUP WORD LOCATION IN ENTRY
	ADD	T2,OFFSET	;OFFSET CONTAINS AOB BLOCK STARTING LOCATION
	CAML	T2,ENTRWC	;DONT TRY EDIT 153 TO ACCESS WORDS OUTSIDE OF ENTRY
	AOJA	CTINDX,PROCSD	;GET NEXT WORD IN CTL TABLE
	CAILE	T2,WKSIZE	;MAKE SURE THE WORD ASKED FOR IS IN WORK BUFFER
	AOJA	CTINDX,PROCSD	;IGNORE AND GET NEXT WORD
	MOVE	P2,WKBUFF(T2)	;PICKUP DATA WORD IN WORK BUFF
	LDB	T3,[POINT 6,P1,17]	;PICKUP WORD PROCESSES MODE
	CAIG	T3,SUBMAX	;IS IT AND UNKNOWN MODE
	PUSHJ	P,SUBTAB(T3)	;ITS RECOGINIZED
	AOJA	CTINDX,PROCSD	;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 WKBUFF
	SKIPL	T2,WKBUFF(T2)	;PICKUP THE ACTUAL POINTER AND SKIP IF LEGAL
	JRST	AOBQIT		;AOBJN POINTER = 0 CLEAN UP PDL AND GO TO PROCSD
;[763]		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,PROCSD	;BUMP CTINDX AND BACK TO START
	SUBTTL	DIALOG RELATED SUBROUTINES
	;HERE IS THE DUMMY PROCSA FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERA.HGH

PROCSA:	MOVE	T1,[SIXBIT/SYSERA/]
	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 PROCSA


	;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


	;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


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

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 PROCSN
	;STARTD-- ROUTINE TO START AT WHEN OVERLAYED
	;TO CORRECTLY PROCESS CURRENT ENTRY.

STARTD:	MOVEI	T1,CHROUT	;OUR TYPO 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
	TRNN	F,F.ENT		;DOING  /ENTRY?  [572]
	TRNE	F,F.SEQ		;SAID /SEQ?  [532]
	 JRST	START1		;YES,FORCE LISTING
	TLZ	F,F.BTCK	;CLEAR EXAMINE ENTRY FLAG
	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
	JRST	ENTRST		;OPP, TRY TO RESYNC
	MOVE	P4,ERRIND
	TLNE	F,F.BTCK	;ANY TO DO?
	PUSHJ	P,@BITCHK(P4)	;GO DO IT
	TRNE	F,F.REM		;[417]/REMOTE?
	 JRST	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)
	SUBTTL	WORD LEVEL SUBROUTINES
	;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	<UDATE>
	SINDEX	<TASCI>
	SINDEX	<PPNWT>

	;SPECIAL LISTING ROUTINES START HERE.


PT%001:	TYPEIT	<
STATUS AT ERROR:
	BAD DATA DETECTED BY:	>	;EDIT [737]
	LDB	T2,[POINT 5,P2,5]	;GET PAGE FAIL CODE
	CAIN	T2,25			;PAGE TABLE?
	 MOVEI	T1,[ASCIZ/PAGE TABLE/]
	CAIN	T2,36			;AR/
	 MOVEI	T1,[ASCIZ/AR/]
	CAIN	T2,37			;ARX?
	 MOVEI	T1,[ASCIZ/ARX/]
	PUSHJ	P,.TSTRG
	TYPEIT	<
	PAGE FAIL WD AT TRAP:	>
	MOVE	T1,P2			;SHOULD STILL BE THERE
	PUSHJ	P,.TXWDW
	TYPEIT	<
	BAD DATA WORD:	>
	MOVE	P1,WKBUFF+PT%BDW	;GET IT
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	<
	GOOD DATA WORD:	>
	MOVE	P2,WKBUFF+PT%GDW	;GOOD CONTENTS,MAYBE
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	XOR	P1,P2			;CREATE DIFFERENCE
	TYPEIT	<
	DIFFERENCE:	>
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	<
	PHYSICAL MEM ADDR.
	 AT FAILURE:	>
	MOVE	T1,WKBUFF+PT%PMA
	PUSHJ	P,.TXWDW
	TYPEIT	<
	RECOVERY:	>
	MOVE	P1,WKBUFF+PT%TRY	;RETRY WORD
	MOVE	T1,[SIXBIT/CONT./]	;ASSUME GOODNESS
	TLNE	P1,ERRHRD		;BETTER CHECK
	 MOVE	T1,[SIXBIT/CRASH/]
	PUSHJ	P,.TSIXN

	TYPEIT	< USER
	RETRY COUNT:	>
	HRRZ	T1,P1
	PUSHJ	P,.ODECW
	TLNE	P1,1B20
	 PUSHJ	P,[TYPEIT	(
	CACHE ERROR,)
		POPJ	P,0]
	TLNE	P1,1B21
	 PUSHJ	P,[TYPEIT	(
	CACHE IN USE,)
		POPJ	P,0]
	TLNE	P1,1B22
	 PUSHJ	P,[TYPEIT	(
	ERROR ON SWEEP TO CORE,)
		POPJ	P,0]
	POPJ	P,0	;BACK TO PROCSD



	;SPECIAL ROUTINES FORTOPS20 RELOAD AND BUGHLT/BUGCHK
	;ARE HERE


RL%001:	TYPEIT	<
RELOAD BREAKDOWN:
>
	SKIPN	P2		;WAS IT BUGHLT?
	 JRST	RL%002		;NO
	TYPEIT	<	BUGHLT ADDRESS:	>
	MOVE	T1,P2		;GET THE ADDR
	PUSHJ	P,.TOCTW
RL%002:	SKIPN	P1,WKBUFF+RL%OPR	;OFFSET FROM WKBUFF
	 POPJ	P,0		;NONE THERE
	TYPEIT	<	WHY RELOAD:	>
	HRRZI	T1,WKBUFF(P1)	;ADDR OF ASCIZ
	PJRST	.TSTRG		;TO OPR COMMENTS


	;HERE FOR 102

BG%001:	TYPEIT	<
	ERROR:		>
	MOVE	T1,[SIXBIT/BUGCHK/]
	CAIN	P2,BG%INF		;BUGINF?
	 MOVE	T1,[SIXBIT/BUGINF/]
	CAIN	P2,BG%HLT		;BUGHLT?
	 MOVE	T1,[SIXBIT/BUGHLT/]	;EDIT 213
	PUSHJ	P,.TSIXN	;SAY EITHER
	PUSHJ	P,.TCRLF
	
	TYPEIT	<	ADDRESS OF ERROR:	>
	MOVE	T1,WKBUFF+BG%ADR
	PUSHJ	P,.TOCTW	;IN OCTAL
	TYPEIT	<
	NAME:			>
	MOVE	T1,WKBUFF+BG%NAM		;GET NAME
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TCRLF
	TYPEIT	<	DESCRIPTION:		>
	HRRZ	T1,WKBUFF+BG%MSG
	ADDI	T1,WKBUFF	;ANOTHER ASCIZ POINTER
	PUSHJ	P,.TSTRG
	PUSH	P,P1
	SETZ	P1,
	PUSHJ	P,DETCHK	;SAID /DETAIL?
	POP	P,P1
	;START [711-RLD]
	TYPEIT	<
	CONI APR:	>
	MOVE	T1,WKBUFF+BG%APS	;GET THE VALUE
	PUSHJ	P,.TXWDW		;IN HALF WORD
	TYPEIT	< = >
	MOVE	P1,WKBUFF+BG%APS
	MOVEI	T1,12			;OFFSET FOR KL10 APR
	SKIPE	KSMON			;KS10 ENTRY ?
	MOVEI	T1,15			;YES! - CHANGE TO KS10 APR OFFSET
	MOVEM	T1,KONTYP		;[722]FINISH THE SETUP
	PUSHJ	P,CNIDCD		;DO TRANSLATION
	TYPEIT	<
	CONI PAG:	>
	MOVE	T1,WKBUFF+BG%PGS
	PUSHJ	P,.TXWDW
	TYPEIT	<
	DATAI PAG:	>
	MOVE	T1,WKBUFF+BG%PGD
	PUSHJ	P,.TXWDW
	;END [711-RLD]
	TYPEIT	<
	CONTENTS OF AC'S:>	;YES
	MOVEI	P1,BG%ACS	;OFFSET OF 1ST
	HRLI	P1,-20		;# TO DUMP
	PUSHJ	P,ACLST
	TYPEIT	<
	PI STATUS:	>
	MOVE	T1,WKBUFF+BG%PIS	;GET THE WORD
	PUSHJ	P,.TXWDW		;IN HALF WORD
	MOVE	P1,WKBUFF+BG%RCT	;# OF REGISTERS
	SKIPN	P1			;BUT IF NONE
	 POPJ	P,0			;LEAVE NOW  [763]
	TYPEIT	<
	ADDITIONAL DATA ITEMS:	>
	MOVE	T1,P1
	PUSHJ	P,.TOCTW
	MOVNS	P1,P1			;MAKE NEGATIVE
	HRLZ	P2,P1			;# TO DUMP  [526]
	HRRI	P2,WKBUFF+BG%REG
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	MOVE	T1,0(P2)		;SOMETHING TO DUMP
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	AOBJN	P2,.-4			;GO BACK IF MORE TO DO
	POPJ	P,0
MP%001:					; [614]
PI%001:	TYPEIT	<
	CONI APR:	>
	MOVE	P1,WKBUFF+PI%CNI	;GET THE APR CONI
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI	T1,12			;OFFSET FOR CONI APR KL10
	SKIPE	KSMON			;KS10 ENTRY ?
	MOVEI	T1,15			;YES! - CHANGE TO KS10 APR OFFSET
	MOVEM	T1,KONTYP
	PJRST	CNIDCD			;GO TRANSLATE  [763]

BG%002:				;  [763]
MP%01A:				;NOW FOR ERA  [763]
PI%01A:	SKIPE	KSMON			;KS10 ENTRY ?  [763]
	 POPJ	P,0			;YES! - LEAVE NOW
	TYPEIT	<
	ERA:		>
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	TYPEIT	< = WD #>
	LDB	T1,[POINT 2,P2,1]	;GET WORD #
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TSPAC
	TLNE	P2,1B20			;SWEEP?
	 PUSHJ	P,[TYPEIT	<, SWEEP REF, >
		POPJ	P,0]
	TLNE	P2,1B21			;CHAN?
	PUSHJ	P,[TYPEIT <, CHAN REF, >
		POPJ	P,0]
	LDB	T2,[POINT 3,P2,6]	;GET DATA SOURCE & WRITE BIT
	MOVE	T1,ERAMES(T2)		;ADDR OF SOME ASCIZ
	PUSHJ	P,.TSTRG

;NOW FOR MEM ADDR  [763]
	TYPEIT	<
	BASE PHY. MEM ADDR.
	 AT FAILURE:	>
	LDB	T1,[POINT 22,P2,35]	;22 BITS OF ADDR 
	PUSHJ	P,.TOCTW		;NOT HALF WORD
	PJRST	.TCRLF			;  [763]

ERAMES:	[ASCIZ/MEMORY READ/]
	[ASCIZ/CHAN STORE STATUS/]
	[ASCIZ/INVALID/]
	[ASCIZ/CHAN DATA/]
	[ASCIZ/INVALID/]
	[ASCIZ/E-BOX STORE/]
	[ASCIZ/CACHE READ/]
	[ASCIZ/CACHE WRITE/]
	;SET UP POINTERS FOR 162 ENTRY  [614]
MP%002:	HRRZI	P1,WKBUFF+MP%ADD	;POINTER TO BAD ADDRESSES
	HRRZI	P2,WKBUFF+MP%DAT	;POINTER TO BAD DATA WORDS
	HRRZI	P3,WKBUFF+MP%CDA	;POINTER TO GOOD DATA WORDS
	JRST	MP%02A			;NOW USE EXISTING CODE FOR 161

	;P2 HAS PI%DAT
PI%002:	HRRZI	P1,WKBUFF+PI%ADD	;POINTER TO BAD ADDRESSES
	HRRZI	P2,WKBUFF+PI%DAT	;POINTER TO BAD DATA WORDS
	HRRZI	P3,WKBUFF+PI%CDA	;POINTER TO GOOD DATA WORDS  [420]
MP%02A:	HRLI	P1,-^D10
	HRLI	P2,-^D10		;# OF WORDS TO DUMP
	HRLI	P3,-^D10
	TYPEIT	<
ERRORS DETECTED DURING SWEEP:
ADDRESS	BAD DATA	GOOD DATA	DIFFERENCE
>

PI%003:	MOVE	T1,0(P1)	;GET ADDRESS
	SKIPN	T1			;ANYTHING THERE?
	 JRST	PI%004			;NO
	TLZE	T1,1B18		;[717] IS GOOD DATA VALID?
	 SETOM	P4		;[717]NO,SET FLAG
	PUSHJ	P,.TOCTW	;NOT HAFWD
	PUSHJ	P,.TTABC
	MOVE	T1,0(P2)	;GET DATA
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TSPAC	;[1258] SO TABS WORK RITE
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TTABC	;[420]LIST GOOD DATA AND XOR DIFFERENCE
	SKIPE	P4		;[717]FLAG SET?
	 JRST	PI%006		;[717]YES, SAY NO GOOD DATA
	MOVE	T1,0(P3)	;GET GOOD DATA
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TSPAC	;[1258] SO TABS WORK RITE
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TSPAC	;[1258]
	PUSHJ	P,.TTABC
	MOVE	T1,0(P2)	;BAD
	MOVE	T2,0(P3)	;GOOD
	XOR	T1,T2		;DIFFERENCE TO T1
	PUSHJ	P,.TXWDW	;LIST IT
				;END [420]
	PUSHJ	P,.TCRLF
PI%004:	AOBJN	P1,.+1
	AOBJN	P3,.+1
	AOBJN	P2,PI%003	;GO DO NEXT OR
	 PUSHJ	P,TITLST	;START ON NEXT PAGE AND
	  POPJ	P,0		;LEAVE



PI%005:	HRLZI	P2,-^D8		;BUILD A POINTER
	HRRI	P2,WKBUFF+PI%SBD	;FOR SBDLST AND THEN
	JRST	SBDLST			;CALL THE RIGHT ROUTINE

;[717]
PI%006:	MOVEI	T1,[ASCIZ/GOOD DATA NOT FOUND
/]
	PUSHJ	P,.TSTRG	;SAY THAT
	SETZ	P4,		;CLEAR THE FLAG
	JRST	PI%004		;GET NEXT WORDS
	;[717] END

	;HERE WE LIST SYSTEM ME CONFIG BASED ON RESULTS OF
	;SBUS DIAG FUNCTIONS STORED IN WKBUFF
	;FIRST IS INTERLEAVE MODE
	;POINTER TO SUBTABLE IS IN P2
SBDLST:	PUSH	P,P1
	SETZ	P1,
	PUSHJ	P,DETCHK	;SAID /DETAIL?
	POP	P,P1
	TYPEIT	<
SYSTEM MEMORY CONFIGURATION:
>
	MOVE	P1,P2
;	SKIPN	P2,0(P1)	;DMA PRESENT?
	 JRST	SBDLS1		;NO
	TYPEIT	<
	INTERLEAVE MODE:	>
	LDB	T2,[POINT 2,P2,7]	;GET INTERLEAVE MODE
	MOVE	T1,[SIXBIT/4 WAY/]	;ASSUME THE BEST
	CAIN	T2,2
	 MOVE	T1,[SIXBIT/2 WAY/]
	CAIN	T2,1
	 MOVE	T1,[SIXBIT/NONE/]	;WE TRIED
	PUSHJ	P,.TSIXN
	TYPEIT	<
	DMA:
	LAST ADDR HELD:	>
	LDB	T1,[POINT 22,P2,35]	;A FEW ADDR BITS
	PUSHJ	P,.TOCTW
	TYPEIT	<
	ERRORS DETECTED:	>
	MOVE	P2,0(P1)
	LDB	P3,[POINT 6,P2,5]	;6 ERROR BITS
	SKIPN	P3			;ANY SET?
	 PUSHJ	P,[TYPEIT (NONE)
		POPJ	P,0]
	TRNE	P3,1B32			;NXM?
	 PUSHJ	P,[TYPEIT (INC. CYCLE)	;[435]
		POPJ	P,0]
	TRNE	P3,1B33			;READ PARITY
	 PUSHJ	P,[TYPEIT (READ PARITY)
		POPJ	P,0]
	TRNE	P3,1B34
	 PUSHJ	P,[TYPEIT (WRITE PARITY)
		POPJ	P,0]
	TRNE	P3,1B35
	 PUSHJ	P,[TYPEIT (ADDR PARITY)
		POPJ	P,0]
SBDLS1:;	AOBJN	P1,.+1	;UPDATE POINTER
;	AOBJN	P1,.+1
	SETZ	P3,

SBDLS2:	SKIPN	P2,1(P1)	;GET FUNCTION 1
	 JRST	SBDLS3		;SETUP FOR NEXT
	TYPEIT	<
CONTROLLER:  >
	MOVE	T1,SBDNAM(P3)	;CONTROLLER #
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TSPAC
	PUSHJ	P,.TSPAC
	LDB	T2,[POINT 4,P2,11]	;GET TYPE
	PUSH	P,T2		;SAVE IT
	MOVE	T1,SBDTYP(T2)
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TSPAC
	PUSHJ	P,.TSPAC
	POP	P,T3	;GET MEMORY TYPE BACK
	LDB	T2,[POINT 4,P2,7]	;# OF MODULES
	SETZ	T1,
	TRNE	T2,1B35		;SM0 PRESENT?
	 ADDI	T1,1
	TRNE	T2,1B34		;SM1?
	 ADDI	T1,1
	TRNE	T2,1B33		;SM2?
	 ADDI	T1,1
	TRNE	T2,1B32		;SM3?
	 ADDI	T1,1
	MUL	T1,SBDSIZ(T3)	;TIMES UNIT SIZE
	MOVE	T1,T2			;ANSWER TO T1
	PUSHJ	P,.TDECW
	TYPEIT	< K>
	TYPEIT	<
F0:	>
	MOVE	T1,0(P1)	;GET FUNCTION 0
	PUSHJ	P,.TXWDW
	TYPEIT	<	F1:	>
	MOVE	T1,1(P1)	;GET FUNCTOON 1
	PUSHJ	P,.TXWDW
	TYPEIT	<
	INTERLEAVE MODE:	>
	MOVE	T2,0(P1)	;GETFINCTION0
	LDB	T3,[POINT 2,T2,7]
	MOVE	T1,SBDINT(T3)	;POINTER TO ASCIZ OF INT. MODE
	PUSHJ	P,.TSTRG
	TYPEIT	<
	REQ ENABLED:	>
	MOVE	P2,1(P1)		;GET FUNCTION 1
	TRNN	P2,1B32		;0?
	JRST	.+3
	TYPEIT	<0 >
	TRNN	P2,1B33
	JRST	.+3
	TYPEIT	<1 >
	TRNN	P2,1B34
	JRST	.+3
	TYPEIT	<2 >
	TRNN	P2,1B35
	JRST	.+3
	TYPEIT	(3)
	TYPEIT	<
	LOWER ADDRESS BOUNDARY:	>
	MOVE	P2,1(P1)	;GET FUNCTION 1
	LDB	T1,[POINT 8,P2,21]	;GETS ADDRESS BITDS
	LSH	T1,^D14		;MOVED OVER TO CONVERT TO BETTER FORMAT
	PUSHJ	P,.TOCTW
	TYPEIT	<
	UPPER ADDRESS BOUNDARY:	>
	LDB	T1,[POINT 4,P2,25]	;GETS 18-21
	LSH	T1,^D14		;MOVED TO CORRECT PLACE
	LDB	T2,[POINT 4,P2,17]	;GET 14-17
	HRL	T1,T2	;SETSUP 14-21 FOR UPPER ADDR
	TRO	T1,37777	;SET THE OTHER BITS
	PUSHJ	P,.TOCTW
	TYPEIT	<
	ERRORS DETECTED:	>
	MOVE	P2,0(P1)
	LDB	P4,[POINT 6,P2,5]	;6 ERROR BITS
	SKIPN	P4			;ANY SET?
	 PUSHJ	P,[TYPEIT (NONE)
		POPJ	P,0]
	TRNE	P4,1B32			;INC CYCLE?
	 PUSHJ	P,[TYPEIT (INC CYCLE)
		POPJ	P,0]
	TRNE	P4,1B33			;READ PARITY
	 PUSHJ	P,[TYPEIT (READ PARITY)
		POPJ	P,0]
	TRNE	P4,1B34
	 PUSHJ	P,[TYPEIT (WRITE PARITY)
		POPJ	P,0]
	TRNE	P4,1B35
	 PUSHJ	P,[TYPEIT (ADDR PARITY)
		POPJ	P,0]
SBDLS3:	AOJ	P3,
	AOBJN	P1,.+1		;UPDATE POINTER TWICE
	AOBJN	P1,SBDLS2	;DO NEXT CONTROLLER YX
	 POPJ		P,0	;ALL DONE

SBDNAM:	SIXBIT/#0/
	SIXBIT/#1/
	SIXBIT/#2/
	SIXBIT/#3/

SBDTYP:	SIXBIT/CUST/
	SIXBIT/MA20/
	SIXBIT/DMA20/
	SIXBIT/MB20/
	SIXBIT/UNKN/

SBDSIZ:	0
	^D16
	0
	^D32

	0

SBDINT:	[ASCIZ/OFF-LINE/]
	[ASCIZ/NONE/]
	[ASCIZ/2-WAY/]
	[ASCIZ/4-WAY/]
	SUBTTL	CONFIGURATION CHANGE ROUTINES

;START EDIT [1204]

CS%001:	PUSHJ	P,.TCRLF
	LDB	P2,[CS.OPR+WKBUFF] ;OUTPUT CORRECT OPERATION CODE
	CAIN	P2,CS%ADV
	JRST	[TYPEIT < ATTACH >
		JRST	CS%01A]
	CAIN	P2,CS%DDV
	JRST	[TYPEIT < DETACH >
		JRST	CS%01A]
	WARN < UNKNOWN CONFIGURATION CHANGE OPERATION!>
	JRST	ABORT

CS%01A:	LDB	P2,[CS.UTP+WKBUFF] ;OUTPUT DRIVE TYPE
	PUSHJ	P,DRVTYP
	TYPEIT < S/N:>		;OUTPUT DRIVE SERIAL #
	LDB	T1,[CS.DSN+WKBUFF] ;  [1215]
	PJRST	.TDECW		; & RETURN TO CONTROL TABLE

CS%002:	TYPEIT < AT CHANNEL #>	;OUTPUT CHANNEL #  [1215]
	LDB	T1,[CS.CHN+WKBUFF]
	PUSHJ	P,.TOCTW
	TYPEIT	< CONTROLLER #>	;OUTPUT CONTROLLER #
	LDB	T1,[CS.CON+WKBUFF]
	PUSHJ	P,.TOCTW
	TYPEIT	< UNIT #>	;OUTPUT UNIT #
	LDB	T1,[CS.UNI+WKBUFF]
	PJRST	.TOCTW		; & RETURN TO CONTROL TABLE

;DISPATCH TABLE OF DEVICE SERIAL NUMBER DECODING ROUTINES IN RH OF LIST

;THIS TABLE MUST BE KEPT IN LINE WITH THE UNIT TYPE TABLE IN THE UNIVERSAL
; FILE.  IN PARTICULAR THERE MUST BE AT LEAST ".UTMAX" ITEMS IN THE TABLE.

SN.LST:	[JRST ABORT]		;ILLEGAL DEVICE
	XWD	0,DSERCD	;RP04
	XWD	0,DSERCD	;RS04
	XWD	0,DSERCD	;TU45
	XWD	0,DSERCD	;TU16
	XWD	0,DSERCD	;RP05
	XWD	0,DSERCD	;RP06
	XWD	0,DSERCD	;RP07
	XWD	0,.ODECW	;RP08
	XWD	0,DSERCD	;RM03
	XWD	0,DSERCD	;TM03
	XWD	0,DSERCD	;TU77
	XWD	0,DSERCD	;TM78
	XWD	0,DSERCD	;TU78
	XWD	0,.ODECW	;DX20
	XWD	0,.ODECW	;TU70
	XWD	0,.ODECW	;TU71
	XWD	0,.ODECW	;TU72
	XWD	0,.ODECW	;TU73

;DISPATCH ROUTINE TO DO DRIVE SERIAL NUMBER CORRECTLY  (S/N IN P2)

DRV$SN:	LDB	T2,[CS.UTP+WKBUFF] ;GET DEVICE TYPE
	HRRZ	T2,SN.LST(T2)	;GET S/N ROUTINE
	MOVE	T1,P2		; .ODECW NEEDS S/N IN T1
	PJRST	@T2		;PRINT S/N

;ROUTINE TO OUTPUT CHANNEL TYPE  (CHANNEL TYPE IN P2)

CHNTYP:	MOVE	T1,RHTYP(P2)	;GET CHANNEL TYPE OUT OF TABLE  [1204]
	PJRST	.TSIXN		;TYPE IT OUT AND RETURN

;END EDIT [1204]
	SUBTTL	FRONT-END ROUTINES

;FE%DEV CODE MOVED TO LIB FOR ENTRY 21 USE  [1006]

	;HERE FOR FRONT END DEVICE REPORTING
	;P2 HAS FE%COD

FE%001:	TYPEIT	<
	DEVICE:	>
	HRRZ	T1,P2		;GET DEV TYPE ALONE
	CAIG	T1,0		;LEGAL TYPE?		START EDIT [514]
	 JRST	FE$UNK		;NO! - UNKNOWN
	CAIG	T1,11		;HARDWARE DEVICE?
	 JRST	FE%HRD		;YES!
	CAIGE	T1,200		;LEGAL PSEUDO TYPE?
	 JRST	FE$UNK		;NO! - UNKNOWN
	CAILE	T1,211		;OVER RANGE?
	 JRST	FE$UNK		;YES! - UNKNOWN
	 JRST	FE%004		;NOPE

FE%HRD:	MOVE	T1,FE$NAM(P2)	;GET DEVICE NAME	END EDIT [514]
	PUSHJ	P,.TSIXN	;IN SIXBIT
	TYPEIT	<  # >
	HLRZ	T1,P2			;GET DEV #
	TRZ	T1,1B18			;CLR THE I DON'T KNOW BIT
	PUSHJ	P,.TOCTW		;OUTPUT #  [730]
	PUSHJ	P,.TCRLF
	TLNN	P2,1B18			;"I DON'T KNOW"?
	 JRST	FE%002			;NO
	TYPEIT	< **DEVICE UNKNOWN TO TOPS**
>

	;NOW GO TO DEVICE DEPENDENT ROUTINES WITH POINTERIN P1

FE%002:	HRRZ	P1,WKBUFF+FE%OFF
	PUSHJ	P,@FE%003(P2)
	POPJ	P,0
FE$NAM:	SIXBIT/UNK/		; [1200]
	SIXBIT/CTY/
	SIXBIT/DL11C/
	SIXBIT/DH11/
	SIXBIT/DLSCAN/
	SIXBIT/LP20/
	SIXBIT/CD20/
	SIXBIT/CLOCK/
	SIXBIT/FE DEV/
	SIXBIT/UNK/

FEHNAM:	SIXBIT/KLCPU/		;200
	SIXBIT/KLERR/		;201
	SIXBIT/UNK/		;202
	SIXBIT/UNK/		;203
	SIXBIT/UNK/		;204
	SIXBIT/UNK/		;205			START EDIT [514]
	SIXBIT/UNK/		;206
	SIXBIT/UNK/		;207
	SIXBIT/KLINIK/		;210
	SIXBIT/UNK/		;211			END EDIT [514]

FE%005:	0,,FE$KLS		;KL RELOAD REPORT FROM FRONT END
	0,,FE$KLF		;KLERROR FILE DUMP
	0,,FE$UNK		;202
	0,,FE$UNK		;203
	0,,FE$UNK		;204
	0,,FE$UNK		;205			START EDIT [514]
	0,,FE$UNK		;206
	0,,FE$UNK		;207
	0,,FE%KLI		;KLINIK EVENT - SHOULD NEVER COME HERE
	0,,FE$UNK		;211			END EDIT [514]


FE%003:	0,,FE$UNK
	0,,FE$UNK
	0,,FE$UNK
	0,,FE$DH1
	0,,FE$UNK
	0,,FE$LP0	;LP20 ROUTINE
	0,,FE$CD0	;CD20 ROUTINE
	0,,FE$UNK
	0,,FE$UNK
	0,,FE$UNK
FE$UNK:	TYPEIT	< - DEVICE IS UNKNOWN TO SYSERR
>
	TYPEIT	<
	DEVICE CODE:	>
	HRRZ	T1,WKBUFF+FE%COD	;GET DEV CODE	
	PUSHJ	P,.TOCTW		;IN OCTAL
UN$KLI:	TYPEIT	<
	DATA IN ERROR BLOCK IN 8 BIT:
>
	MOVE	P2,WKBUFF+FE%OFF	;GET OFFSET
	ADDI	P2,WKBUFF		;CORRECT IT
FE$UN1:	PUSHJ	P,.TTABC
	MOVE	T1,0(P2)		;GET VALUE
	PUSHJ	P,BYTE.8		;IN 8 BIT FORMAT
	PUSHJ	P,.TCRLF
	AOBJN	P2,FE$UN1		;MORE TO DO
	 POPJ	P,0

FE%004:	SUBI	T1,200		;REMOVE OFFSET
	MOVE	P3,T1		;SAVE IT
	MOVE	T1,FEHNAM(P3)	;GET A NAME
	PUSHJ	P,.TSIXN
	HRRZ	P1,WKBUFF+FE%OFF	;SETUP OFFSET
	PUSHJ	P,@FE%005(P3)	;GO TO DEVICE ROUTINES
	POPJ	P,0		;THEN BACK TO PROCSD

COMMENT \ I THINK THIS ROUTINE CAN BE REMOVED  [PJB]

	;ROUTINE TO UNPACK 3 WORDS FROM KLEFIL INTO ONE
	;PDP-10 WORD IN T1.  P1 HOLDS POINTER TO 1ST
	;WORD AND IS UPDATED IN THIS ROUTINE.
FE$BWD:	MOVE	T2,KLEFIL(P1)	;GET 1ST PORTION
	DPB	T2,[POINT 16,T1,35]
	ADDI	P1,1		;UPDATE
	MOVE	T2,KLEFIL(P1)	;GET 2ND
	DPB	T2,[POINT 16,T1,19]
	ADDI	P1,1		;UPDATE AGAIN
	MOVE	T2,KLEFIL(P1)	;GET 3RD
	DPB	T2,[POINT 4,T1,3]	;LAST BITS
	POPJ	P,0		;WORD IN T1 SO RETURN
\
FE$LP0:	TYPEIT	<
	STD. STATUS:	>
	MOVE	P1,WKBUFF+FE%OFF	;GET FUL OFFSETWORD
	ADDI	P1,WKBUFF		;CORRECT TO POINT INTO WKBUFF
	LDB	T1,[POINT 16,(P1),15]	;GET DV.XXX
	PUSH	P,P1			;SAVE A POINTER
	PUSH	P,T1			;SAVE THE WORD
	PUSHJ	P,.TOCTW
	MOVEI	T1,36			;CORRECTOFFSET
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION

	;NOW FOR 2ND STATUS BYTE
	TYPEIT	<
	LP20 GEN STATUS:	>
	POP	P,P1			;GET POINTER BACK
	PUSH	P,P1	;SAVE IT STILL
	LDB	T1,[POINT 16,(P1),31]	;GET DD.LP20
	PUSH	P,T1		;SAVEIT
	PUSHJ	P,.TOCTW
	POP	P,P1			;GET IT BACK
	MOVEI	T1,37			;OFFSET
	MOVEM	T1,KONTYP		;SETUP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
	POP	P,P1			;GET POINTER BACK
	AOBJN	P1,.+1			;SKIP 2 11-WORDS FOR NOW
	AOBJN	P1,.+1			;POINT AT NEXT TWO
	HRLI	P1,-^D8			;# OF REGISTERS TO LIST
	HRLI	P2,LP$REG		;ADDR OF REG NAMES
	HRRI	P2,LP$CON		;ADDR OF CONTROL TABLE
	TYPEIT	<
	LP20 DEVICE REGISTERS
>
	PUSHJ	P,LSTEB			;LIST DEVICE REGISTERS
	PUSHJ	P,TITLST		;START ON NEXT PAGE
	POPJ	P,0

	;TABLES FOR LP20 LISTINGS
LP$REG:	SIXBIT/LPCSRA/
	SIXBIT/LPCSRB/
	SIXBIT/LPBSAD/
	SIXBIT/LPBCTR/
	SIXBIT/LPPCTR/
	SIXBIT/LPRAMD/
	SIXBIT/LPCCTR/
	SIXBIT/LPTDAT/


LP$CON:	40,,0
	41,,0
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,LPCLST
	-1,,LPDLST
;DH11 ROUTINES   (UPDATED WITH EDIT 1210)

FE$DH1:	TYPEIT	<
	STD. STATUS:	>
	MOVE	P1,WKBUFF+FE%OFF	;GET OFFSET WORD
	ADDI	P1,WKBUFF		; & POINT INTO WKBUFF
	LDB	T1,[STD.ST(P1)]		;GET STANDARD STATUS WORD
	PUSH	P,P1			;SAVE A POINTER
	PUSH	P,T1			;SAVE THE WORD
	PUSHJ	P,.TOCTW
	TYPEIT	< = >
;	POP	P,P1			;GET THE WORD BACK
;	PUSH	P,P1			;AND SAVE IT STILL
	MOVE	P1,0(P)			;[1247] REPLACES ABOVE 2 INSTS.
	MOVEI	T1,36			;CORRECT OFFSET
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION
	POP	P,P2			;GET THE WORD BACK
	POP	P,P1			;AND THE POINTER
	TRNE	P2,1B26			;IF HUNG DEVICE
	JRST FE$DHB			; DUMP 4 COUNTERS
;START EDIT [1223]
	TYPEIT	<
	DH11 UNIBUS ADDRESS:	>
	LDB	T1,[DH.ADR(P1)]		;GET ADDRESS WORD
	PUSHJ	P,.TOCTW		;DUMP IN OCTAL
	TYPEIT	< = DH11 #>
	LDB	T1,[DH.RHN(P1)]		;GET DH11 #+1
	SOS	T1			;MAKE IT REAL DH11 #
	PUSHJ	P,.TOCTW		;DUMP IN OCTAL
	LDB	P2,[DH.SCR(P1)]		;GET SYSTEM CONTROL REGISTER
	JUMPE	P2,FE$DHA		; & SKIP IF 0
	TYPEIT	<
	SYSTEM CONTROL REG:	>
	MOVE	T1,P2
	PUSH	P,P1			;SAVE A POINTER
	PUSH	P,T1			;SAVE THE WORD
	PUSHJ	P,.TOCTW
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	MOVEI	T1,57			;CORRECT OFFSET
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION
	TYPEIT	<LINE #>
	POP	P,P1			;GET THE POINTER
	LDB	T1,[DH.LIN(P1)]		;GET LINE NUMBER
	PUSHJ	P,.TOCTW
FE$DHA:	LDB	P2,[DH.NRC(P1)]		;GET RECEIVED CHARACTER REGISTER
	SKIPN	P2			; & QUIT IF 0
	POPJ	P,0
	TYPEIT	<
	RECEIVED CHAR REG:	>
	MOVE	T1,P2
	PUSH	P,P1			;SAVE A POINTER
	PUSH	P,T1			;SAVE THE WORD
	PUSHJ	P,.TOCTW
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	MOVEI	T1,60			;CORRECT OFFSET
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION
	TYPEIT	<LINE #>		;[1247]
	POP	P,P1			;GET THE POINTER
	LDB	T1,[DH.NLN(P1)]		;GET NEXT LINE NUMBER
	PUSHJ	P,.TOCTW
	TYPEIT	<,CHAR=>		;[1247]
	LDB	T1,[DH.NCH(P1)]		;GET NEXT CHARACTER
	PJRST	.TOCTW			;THAT'S ALL TO LIST
;END EDIT [1223]

FE$DHB:	TYPEIT	<
	CONTENTS OF COUNTERS:	>
	LDB	T1,[DH.CT1(P1)]	;GET FIRST
	PUSHJ	P,.TOCTW	;LIST IT
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	LDB	T1,[DH.CT2(P1)]	;GET SECOND
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	LDB	T1,[DH.CT3(P1)]	;GET THIRD
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	LDB	T1,[DH.CT4(P1)]	;GET FOURTH
	PJRST	.TOCTW		;THAT'S ALL TO LIST

FE$CD0:	TYPEIT	<
	STD. STATUS:	>
	MOVE	P1,WKBUFF+FE%OFF	;GET FUL OFFSETWORD
	ADDI	P1,WKBUFF		;CORRECT TO POINT INTO WKBUFF
	LDB	T1,[POINT 16,(P1),15]	;GET DV.XXX
	PUSH	P,P1			;SAVE A POINTER
	PUSH	P,T1			;SAVE THE WORD
	PUSHJ	P,.TOCTW
	MOVEI	T1,36			;CORRECTOFFSET
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION

	;NOW FOR 2ND STATUS BYTE
	TYPEIT	<
	CD20 GEN STATUS:	>
;	POP	P,P1			;GET POINTER BACK
;	PUSH	P,P1	;SAVE IT STILL
	MOVE	P1,0(P)			;[1247]REPLACES ABOVE 2 INSTS.
	LDB	T1,[POINT 16,(P1),31]	;GET DD.CD11
	PUSH	P,T1		;SAVEIT
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TTABC
	POP	P,P1			;GET IT BACK
	MOVEI	T1,42			;OFFSET
	MOVEM	T1,KONTYP		;SETUP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
	POP	P,P1			;GET POINTER BACK
	AOBJN	P1,.+1			;SKIP 2 BYTES FOR NOW
	TYPEIT	<
	CD20 DEVICE REGISTERS
	>
	MOVE	T1,[SIXBIT/CD11ST/]
	PUSHJ	P,.TSIXN	;INSIXBIT
	PUSHJ	P,.TTABC
	LDB	T1,[POINT 16,(P1),31]
	PUSH	P,T1			;SAVE IT
	PUSHJ	P,.TOCTW		;IN OCTAL
	MOVEI	T1,43		;OFFSET FOR THIS REG
	MOVEM	T1,KONTYP
	PUSHJ	P,.TTABC	;SOME SPACE
	POP	P,T1			;GETWORD BACK
	PUSHJ	P,SAVE4P		;SAVE AC'S
	MOVE	P1,T1		;SETUP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD	;GO DECODE
	PUSHJ	P,RET4P			;RETURN THOSE AC'S
	PUSHJ	P,.TCRLF
	AOBJN	P1,.+1			;ADJUST FOR WORDS WE JUST DID
	HRLI	P1,-^D3			;# OF REGISTERS TO LIST
	HRLI	P2,CD$REG		;ADDR OF REG NAMES
	HRRI	P2,CD$CON		;ADDR OF CONTROL TABLE
	PUSHJ	P,LSTEB			;LIST DEVICE REGISTERS
	PUSHJ	P,TITLST		;START ON NEXT PAGE
	POPJ	P,0


	;TABLES FOR CD11 LISTINGS

CD$REG:	SIXBIT/CD11CC/
	SIXBIT/CD11BA/
	SIXBIT/CD11DB/


CD$CON:	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	;KLCPU

FE$KLS:	TYPEIT	<
	STD. STATUS:	>
	MOVE	P1,WKBUFF+FE%OFF	;GET FUL OFFSETWORD
	ADDI	P1,WKBUFF		;CORRECT TO POINT INTO WKBUFF
	LDB	T1,[POINT 16,(P1),15]	;GET DV.XXX
	PUSH	P,P1			;SAVE A POINTER
	PUSH	P,T1			;SAVE THE WORD
	PUSHJ	P,.TOCTW
	MOVEI	T1,36			;CORRECTOFFSET
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION

	;NOW FOR 2ND STATUS BYTE
	TYPEIT	<
	KL RELOAD STATUS FROM FRONT END:  >
;	POP	P,P1			;GET POINTER BACK
;	PUSH	P,P1	;SAVE IT STILL
	MOVE	P1,0(P)			;[1247]REPLACES ABOVE 2 INSTS.
	LDB	T1,[POINT 16,(P1),31]	;GET DD.KLWD
	PUSH	P,T1		;SAVEIT
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TTABC
	POP	P,P1			;GET IT BACK
	MOVEI	T1,46			;OFFSET
	MOVEM	T1,KONTYP		;SETUP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
	POP	P,P1			;GET POINTER BACK
	POPJ	P,0		;THAT'S ALL
;FE.KLI (FE$KLI) CODE MOVED TO LIB FOR USE BY 21 ENTRY  [1006]

	;CHECK FOR KLINIK EVENT

FE%KLI:	HRRZ	T1,P2		;GET TYPE ALONE (FE%COD)
	CAIE	T1,.KLINK	;IS THIS KLINIK EVENT?
	 POPJ	P,0		;NO! - OK - LEAVE
	TYPEIT	<
!!!! KLINIK EVENT:  >		;YES!

	;FIND MESSAGE TYPE

	MOVE	P1,WKBUFF+FE%OFF	;GET PACKET OFFSET
	ADDI	P1,WKBUFF		;CREATE POINTER
	LDB	T1,[K.LTYP(P1)]		;GET EVENT TYPE
	CAIN	T1,K.LCKL		;CLEAR KLINIK?
	 PJRST	K%LCKL			;YES! - LIST
	CAIL	T1,0			;NO! - GOOD MESSAGE TYPE?
	 CAILE	T1,K.LRBA		;MAYBE! - HIGH SIDE GOOD?
	  PJRST	KLI$UN			;NO! - REPORT ERROR
	LDB	T2,[K.LCOD(P1)]		;YES! - PASS EVENT CODE IN T2
	PJRST	@KLI%TY(T1)		;REPORT EVENT

KLI$UN:	TYPEIT	<BAD KLINIK MESSAGE TYPE !!!!
>
	WARN	<*BAD KLINIK MESSAGE TYPE*
>
	PUSHJ	P,UN$KLI		;OUTPUT IN OCTAL
	JRST	ABORT			;GIVE UP


	;MESSAGE TYPE DISPATCH TABLE
	; DOES NOT INCLUDE 'CLEAR KLINIK' (-1 IN 8BIT IS 377)

KLI%TY:	0,,KLI$UN			;(0) UNKNOWN
	0,,K%LSKL			;(1) SET KLINIK
	0,,K%LRNG			;(2) KLINIK LINE RING
	0,,K%LDSC			;(3) KLINIK LINE DISCONNECT
	0,,K%LCON			;(4) KLINIK LINE CONNECT
	0,,K%LBPW			;(5) KLINIK BAD PASSWORD
	0,,K%LLTO			;(6) KLINIK UNSUCCESSFUL LOGON
	0,,K%LRBA			;(7) KLINIK ACTIVE ON REBOOT
	;CLEAR KLINIK  (-1)(377)

K%LCKL:	TYPEIT	<CLEAR - WINDOW CLOSED !!!!
>
	JRST	ABORT			;THAT'S ALL

	;SET KLINIK  (1)

K%LSKL:	TYPEIT	<SET !!!!
>

	;KLINIK PARAMETERS  (-1,1)

K%LSCK:	TYPEIT	<WINDOW OPENED FROM >
	LDB	T1,[POINT 16,1(P1),15]	;GET OPEN TIME
	IMULI	T1,^D2000		;CHANGE TO MILLISEC
	PUSHJ	P,.TTIME		;OUTPUT  HH:MM:SS
	PUSHJ	P,.TSPAC		;OUTPUT SPACE
	LDB	P2,[POINT 8,1(P1),23]	;GET OPEN MONTH
	LDB	P3,[POINT 8,1(P1),31]	;GET OPEN YEAR
	LDB	T1,[POINT 8,2(P1),15]	;GET OPEN DAY
	PUSHJ	P,K.DATE		;OUTPUT  DD-MMM-YY
	TYPEIT	< TO >
	LDB	T1,[POINT 16,2(P1),31]	;GET CLOSE TIME
	IMULI	T1,^D2000		;CHANGE TO MILLISEC
	PUSHJ	P,.TTIME		;OUTPUT  HH:MM:SS
	PUSHJ	P,.TSPAC		;OUTPUT SPACE
	LDB	P2,[POINT 8,3(P1),7]	;GET CLOSE MONTH
	LDB	P3,[POINT 8,3(P1),15]	;GET CLOSE YEAR
	LDB	T1,[POINT 8,3(P1),31]	;GET CLOSE DAY
	PUSHJ	P,K.DATE		;OUTPUT  DD-MMM-YY
	TYPEIT	<
		FOR >
	LDB	T1,[POINT 8,4(P1),15]	;GET MODE
	CAIN	T1,377			;USER MODE?
	 PJRST	K%LUSR			;YES!
	LDB	T2,[POINT 8,4(P1),7]	;NO! - GET LIMIT   [605]
;TRANSLATE 11 LIMIT WORD TO AGREE WITH THOSE FOR
; MODE IN RING ACCEPTED
	IDIVI	T2,3			;1,3,7 TO 0,1,2  [605]
	ADDI	T2,1			;0,1,2 TO 1,2,3  [605]
	PJRST	K.CON			;USE ROUTINE FOR RING
;K.DATE -- KLINIK DATE ROUTINE
;OUTPUTS DATE WITH ALPHA MONTH:   "DD-MMM-YY"
;CALL:	MOVEI	T1,DAY OF MONTH  (1-31)
;	MOVEI	P2,MONTH	 (1-12)
;	MOVEI	P3,YEAR  (BASE DATE 1900)
;	PUSHJ	P,K.DATE
;USES:	T1,T2,T3,P2,P3

K.DATE:	PUSHJ	P,.TDECW		;OUTPUT DAY
	MOVE	T1,.MONTH(P2)		;GET SIXBIT MONTH
	PUSHJ	P,.TSIXN		;OUTPUT MONTH
	MOVE	T1,P3			;GET YEAR
	PUSHJ	P,.TDECW		;OUTPUT YEAR
	POPJ	P,0			;RETURN

.MONTH:	0
	SIXBIT/-JAN-/
	SIXBIT/-FEB-/
	SIXBIT/-MAR-/
	SIXBIT/-APR-/
	SIXBIT/-MAY-/
	SIXBIT/-JUN-/
	SIXBIT/-JUL-/
	SIXBIT/-AUG-/
	SIXBIT/-SEP-/
	SIXBIT/-OCT-/
	SIXBIT/-NOV-/
	SIXBIT/-DEC-/
	;KLINIK LINE RING  (2)

K%LRNG:	TYPEIT	<RING >
	CAIN	T2,1			;ACCEPTED?
	 PJRST	K%LRAC			;YES!
	CAIN	T2,377			;NO! - REJECTED? (-1)
	 PJRST	K%LRRJ			;YES!
K$LERR:	TYPEIT	<ILLEGAL MODE ERROR !!!!>	;NO! - HUH!  [605]
	JRST	ABORT			;GIVE UP

K%LRAC:	TYPEIT	<ACCEPTED !!!!>		;WINDOW OPEN  (1)
	JRST	ABORT			;THAT'S ALL
K%LRRJ:	TYPEIT	<REJECTED !!!!>		;WINDOW CLOSED  (-1)
	JRST	ABORT			;THAT'S ALL

	;KLINIK LINE DISCONNECT  (3)

K%LDSC:	TYPEIT	<DISCONNECTED >
	CAIN	T2,1			;ON PURPOSE?
	 PJRST	K%LDCM			;YES!
	CAIN	T2,377			;NO! - LINE DROP?  (-1)
	 PJRST	K%LDRP			;YES!
	PJRST	K$LERR			;NO! - HELP!

K%LDCM:	TYPEIT	<BY CTY OR TIMEOUT !!!!>
	JRST	ABORT			;THAT'S ALL
K%LDRP:	TYPEIT	<- LINE DROP DETECTED !!!!>
	JRST	ABORT			;THAT'S ALL
	;KLINIK LINE CONNECT  (4)

K%LCON:	TYPEIT	<CONNECTED IN >
K%CON:	CAIN	T2,377			;USER MODE?
	 PJRST	K%LUSR			;YES!
K.CON:	TYPEIT	<REMOTE >		;NO!
	CAILE	T2,0			;MODE IN RANGE?
	 CAILE	T2,3			;MAYBE! - HIGH SIDE GOOD?
	  PJRST	K$LERR			;NO! - BAD MODE
	PJRST	@K$LCON(T2)		;YES!

K$LCON:	0,,K$LERR			;BAD MODE
	0,,K%LROP			;(1) REMOTE OPERATOR	(1)
	0,,K%LRPR			;(2) REMOTE PROGRAMMER	(3)
	0,,K%LRMN			;(3) REMOTE MAINTENANCE	(7)

K%LUSR:	TYPEIT	<USER>			;(-1) (377)
	JRST	K$MODE
K%LROP:	TYPEIT	<OPERATOR>		;(1)
	JRST	K$MODE
K%LRPR:	TYPEIT	<PROGRAMMER>		;(2)
	JRST	K$MODE
K%LRMN:	TYPEIT	<MAINTENANCE>		;(3)
K$MODE:	TYPEIT	< CONSOLE MODE !!!!>
	JRST	ABORT			;THAT'S ALL
	;KLINIK BAD PASSWORD  (5)

K%LBPW:	TYPEIT	<BAD PASSWORD #>
	MOVE	T1,T2			;GET # IN 'T1'
	PUSHJ	P,.TDECW		;OUTPUT IT
	TYPEIT	< IS:  >
	LDB	T1,[K.BPW1(P1)]		;GET FIRST CHARACTER
	PUSHJ	P,.TCHAR		;TYPE IT
	LDB	T1,[K.BPW2(P1)]		;SECOND
	PUSHJ	P,.TCHAR
	LDB	T1,[K.BPW3(P1)]		;THIRD
	PUSHJ	P,.TCHAR
	LDB	T1,[K.BPW4(P1)]		;FOURTH
	PUSHJ	P,.TCHAR
	LDB	T1,[K.BPW5(P1)]		;FIFTH
	PUSHJ	P,.TCHAR
	LDB	T1,[K.BPW6(P1)]		;SIXTH
	PUSHJ	P,.TCHAR
	TYPEIT	<  !!!!>
	JRST	ABORT			;THAT'S ALL

	;KLINIK UNSUCCESSFUL LOGON  (6)

K%LLTO:	TYPEIT	<UNSUCCESSFUL LOGON - >
	MOVE	T1,T2			;GET # OF GOOD PASSWORDS
	PUSHJ	P,.TDECW		;OUTPUT IT
	TYPEIT	< PASSWORDS ATTEMPTED !!!!>
	JRST	ABORT			;THAT'S ALL

	;KLINIK ACTIVE ON REBOOT  (7)

K%LRBA:	TYPEIT	<ACTIVE IN >
	PJRST	K%CON		;SAME AS 'KLINIK CONNECT'

	;THIS IS A MAP OF TE FORMAT OF TE  KLERROR FILE AFTER
	;IT IS REBUILT INTO SYSER'S LOW SEGMENT.  THE DEFINED
	;VALUES ARE THE OFFSETS TO THHE START OF THE FILE.
	
	KR.FTY==0		;KLERROR FORMAT VERSION
	KR.RLC==1		;RECORD LENGTH IN BYTES
	KR.TMYR==2		;TIME OF DAY - YEAR
	KR.TMMO==3		;   - MONTH
	KR.TMDA==4		;   - DAY
	KR.TMHR==5		;   - HOUR
	KR.TMMI==6		;   - MINUTE
	KR.TMSE==7		;   - SECOND

	KR.KSN==12		;KL SER #
	KR.ESN==13		;FE SER #
	KR.UVN==14		;MICRO CODE VERSION
	KR.MVN==15		;MONITOR VERSION
	KR.RVN==21		;FE SOFT VER #
	KR.ECD==23		;ERROR CODE
	KR.DG1==24		;DTE DIAG 1
	KR.DG2==25		;DTE DIAG 2
	KR.DGS==26		;DTE DIAG STATUS
	KR.DG3==27		;DTE DIAG 3
	KR.FNR==30		;START OF FUNCTION READ VALUES
	KR.IPE==330		;-11 RAD 50 ERROR WROD
	KR.CHK==337		;CHECKSUM FOR ABOVE DATA
	;HERE ARE ROUTINES TO DUMP KLEFIL 
FE$KLF:	TYPEIT	<
	CONTENTS OF KLERROR FILE:
>
	TYPEIT	<CONTENTS OF RECORD #1  SEEN AT FIRST ERROR
>
KLFCON:	TYPEIT	<	CREATED:  >
	MOVEI	P1,KR.TMYR		;OFFSET TO START OF DATE/TIME
	MOVE	T1,KLEFIL+1(P1)	;GET MONTH FIRST
	PUSHJ	P,.TDECW	;IN DECIMAL
	PUSHJ	P,.TCOLN
	MOVE	T1,KLEFIL+2(P1)	;NOW DAY
	PUSHJ	P,.TDECW
	PUSHJ	P,.TCOLN
	MOVE	T1,KLEFIL(P1)	;YEAR
	PUSHJ	P,.TDECW
	TYPEIT	< AT: >
	MOVE	T1,KLEFIL+3(P1)	;NOW HOUR
	PUSHJ	P,.TDECW
	PUSHJ	P,.TCOLN
	MOVE	T1,KLEFIL+4(P1)	;MINUTES
	PUSHJ	P,.TDECW
	PUSHJ	P,.TCOLN
	MOVE	T1,KLEFIL+5(P1)	;SECONDS
	PUSHJ	P,.TDECW
	
	TYPEIT	<	FILE FORMAT VERSION:	>
	MOVE	T1,KLEFIL	;1ST WORD IS VERSION #
	PUSHJ	P,.TOCTW
	TYPEIT	<	RECORD LENGTH:	>
	MOVEI	P1,KR.RLC		;OFFSET TO VALUE
	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
	PUSHJ	P,.TOCTW
	TYPEIT	< BYTES
>
;	TYPEIT	< BYTES
;	U-CODE VER:	>
;	MOVEI	P1,KR.UVN
;	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
;	PUSHJ	P,.ODECW	;IN DECIMAL
;	TYPEIT	<	FE SER #:	>
;	MOVEI	P1,KR.ESN
;	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
;	PUSHJ	P,.ODECW	;IN DECIMAL
;	TYPEIT	<	KL SER #:	>
;	MOVEI	P1,KR.KSN
;	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
;	PUSHJ	P,.ODECW	;IN DECIMAL
;	TYPEIT	<
;	MONITOR VER:	>
;	MOVEI	P1,KR.MVN
;	PUSHJ	P,FE$BWD	;GET 3 WORDS
;	PUSHJ	P,.ODECW
;ABOVE 17 LINES REMOVED WITH EDIT 517
;	TYPEIT	<	FE SOFTWARE VER:	>
;	MOVEI	P1,KR.RVN
;	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
;	PUSHJ	P,.ODECW	;IN DECIMAL
	MOVEI	P1,KR.ECD
	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
	MOVE	P2,T1		;SAVE IT FOR TRANSLATION
	SKIPN	T1		;[517] IF ZERO,
	 JRST	KLFCN1		;DON'T LIST IT
	TYPEIT	<
	EXCEPTION CODE:	>
	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
	PUSHJ	P,.TOCTW	;IN DECIMAL
	TYPEIT	< = >
	PUSHJ	P,KR%ECD	;DECODE ERROR CODE

;KR%ECD CODE MOVED TO LIB FOR ENTRY 21 USE  [1006]

KLFCN1:	PUSHJ	P,.TCRLF
	TYPEIT	<	DTE DIAG STATUS:	>
	MOVEI	P1,KR.DGS
	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
	PUSHJ	P,.TOCTW	;IN DECIMAL
	TYPEIT	<
	DTE DIAG 1:	>
	MOVEI	P1,KR.DG1
	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
	PUSHJ	P,.TOCTW	;IN DECIMAL
	TYPEIT	<	DTE DIAG 2:	>
	MOVEI	P1,KR.DG2
	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
	PUSHJ	P,.TOCTW	;IN DECIMAL
	TYPEIT	<	DTE DIAG 3:	>
	MOVEI	P1,KR.DG3
	MOVE	T1,KLEFIL(P1)	;GET THAT VALUE
	PUSHJ	P,.TOCTW	;IN DECIMAL
;NOW DUMP FUNCTION READS
	HRLI	P1,-100		;NUMBER TO DO
	HRRI	P1,KR.FNR		;STARTING OFFSET
	MOVEI	P2,0		;WHERE TO PUT THE WORDS
FE$KL1:	MOVE	T2,KLEFIL(P1)	;GET 1ST PORTION
	DPB	T2,[POINT 16,T1,35]
	ADDI	P1,1		;UPDATE
	MOVE	T2,KLEFIL(P1)	;GET 2ND
	DPB	T2,[POINT 16,T1,19]
	ADDI	P1,1		;UPDATE AGAIN
	MOVE	T2,KLEFIL(P1)	;GET 3RD
	DPB	T2,[POINT 4,T1,3]	;LAST BITS
	MOVEM	T1,KLEFIL(P2)	;PUT AWAY THE WORD
	AOS	P2
	AOBJN	P1,FE$KL1	;UPDATE & DO NEXT

;HERE SETUP TO CALL SYSERK TO LIST CONTENTS
	SETZ	15,	;CLEAR OLD STARTING ADDRESS
	MOVEI	14,FE$KLA	;SETUP RETURN ADDRESS
	MOVE	T1,[SIXBIT/SYSERK/]
	MOVEM	T1,OVRBLK+1	;HIS NAME
	MOVE	16,[SIXBIT/SYSERD/]	;OUR NAME FOR PROPER RETURN
	MOVEM	17,SAVEAC+17
	MOVEI	17,SAVEAC
	BLT	17,SAVEAC+16	;STORE AC'S
	JRST OVRLAY		;GO REPLACE US

;WHEN SYSERK IS FINISHED IT WILL CALL SYSERD BACK AND
;THE OVERLAY WILL USE THE NEXT LINE AS THE STARTING ADDRESS INSTEAD
;OF THAT STORED BY LINK
FE$KLA:	MOVEI	15,0		;CLEAR RETURN ADDRESS
	MOVEI	T1,CHROUT
	PUSHJ	P,.TYOCH	;RE-INIT SCAN ROUTINES
	PUSHJ	P,.TCRLF	;NEXT LINE PLEASE
	MOVEI	P1,KR.IPE		;MIGHT BE LOCATION 330??

	SKIPN	P2,KLEFIL(P1)	;ANY ERRORS DETECTED
	 JRST	FE$KLB		;NOPE
	TYPEIT	<**** DATA MAY NOT BE VALID ****>
	PUSHJ	P,.TCRLF
	TYPEIT	<	ERROR DETECTED:	>
	MOVE	T1,P2
	PUSHJ	P,R5VSIX	;CONVERT IT TO SIXBIT
	HRLZ	T1,T1		;MOVE IT OVER
	PUSHJ	P,.TSIXN	;NOW DUMP IT

FE$KLB:	SKIPE	KLEFL1		;-1 NOW SAYS WE JUST LISTED 2ND RECORD
	 JRST 	FE$KLC		;SO RETURN TO PROCSD
	HRRZ	T1,KLEPNT	;GET LAST ADDR USED TO BUILD THIS FILE
	CAIG	T1,KLE1FL	;USED SECOND RECORD?
	 JRST	FE$KLC		;NO-RETURN NOE
	CAIL	T1,KLEFIL	;ANY WORDS IN 2ND RECORD?
	 JRST FE$KLC		;NO SO DON'T GO ANY FURTHER
	SETOM	KLEFL1		;YES, WE MUST LIST THEM TOO
;*******
;IF DEBUGGING, BETTER PUT A BREAKPOINT HERE IF YOU WANT TO
;SEE THE CONTENTS OF THE 1ST RECORD.  IT WON'T BE AROUND MUCH
;LONGER!!!!!
;********
	SETZM	KLEFIL				;CLEAR
	MOVE	T1,[XWD KLEFIL,KLEFIL+1]	;THE FIRST
	BLT	T1,KLEEND-1			;FILE AREA
	MOVE	T1,[XWD KLE1FL,KLEFIL]	;THEN COPY THE 2ND RECORD
	BLT	T1,KLEEND-1	;TO THE 1ST RECORD AREA.
	PUSHJ	P,TITLST		;START ON NEXT PAGE
	TYPEIT	<

LISTING 2ND RECORD, THE LAST ERROR SEEN

>
	JRST	KLFCON	;USE ALL THE SAME CODE AGAIN
FE$KLC:	PUSHJ	P,TITLST	
	SETZM	KLEFL2		;NO MORE BUILDING OF KLEFIL
	SETZM	KLEFL3		;OR LISTING EITHER
	SETZM	KLEFL1		;CLEAR THAT ONE TOO
	POPJ	P,0	

;SPECIAL TRANSLATION FOR LP20 REGISTERS

LPCLST:	MOVE	P1,T1		;GET WORD
	TYPEIT	<COL. CNTR. = >
	LDB	T1,[POINT 8,P1,27]	;UPPER BYTE
	PUSHJ	P,.TOCTW
	TYPEIT	< CHAR. BUF = >
	LDB	T1,[POINT 8,P1,35]	;LOWER BYTE
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	POPJ	P,0

LPDLST:	MOVE	P1,T1			;GET THE WORD
	TYPEIT	<CHKSUM = >
	LDB	T1,[POINT 8,P1,27]	;UPPER BYTE
	PUSHJ	P,.TOCTW
	TYPEIT	< LPT DATA = >
	LDB	T1,[POINT 8,P1,35]	;LOWER BYTE
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	POPJ	P,0

	;SPECIAL ROUTINE FOR CODE 131 FRONT END RELOAD
	;P2 HAS R1%NUM

R1%000:	TYPEIT	<
	FRONT END #:	>
	MOVEI	T1,[ASCIZ/PRIVILEGED  /]
	TLZE	P2,1B18		;IS IT?
	 PUSHJ	P,.TSTRG		;YUP
	MOVE	T1,P2
	PUSHJ	P,.TOCTW
	MOVE	P3,WKBUFF+R1%STS	;GET STATUS WORD
	TYPEIT	<
	STATUS AT RELOAD:	>
	MOVE	P1,P3
	MOVEI	T1,45			;OFFSET
	MOVEM	T1,KONTYP
	PUSH	P,P3			;SAVE THE STATUS WORD
	PUSHJ	P,CNIDCD
	TYPEIT	<
	RETRIES:	>
	POP	P,P3		;GET STATUS BACK
	LDB	T1,[POINT 6,P3,35]
	PUSHJ	P,.TDECW
	;[534]
;[543]
	LDB	P1,[POINT 16,WKBUFF+R1%ERW,17]
	CAIN	P1,1		;NOTHING TO LIST?
	 POPJ	P,0		;YES, GO BACK
	PUSH	P,P1		;SAVE P1
	TYPEIT	<
	REASON FOR RELOAD:	>
	POP	P,P1		;RESTORE P1
	LDB	T1,[POINT 7,P1,35]
	PUSHJ	P,.TCHAR
	LDB	T1,[POINT 7,P1,27]
	PUSHJ	P,.TCHAR
	LDB	P1,[POINT 16,WKBUFF+R1%ERW,35]
	LDB	T1,[POINT 7,P1,35]
	PUSHJ	P,.TCHAR
	LDB	P1,[POINT 7,P1,27]	;[544]
	SKIPN	P1		;IF ZERO, DONT LIST IT
	 POPJ	P,0		;RETURN NOW
	PUSH	P,P1		;SAVE P1
	TYPEIT	<
	HIGH 7 BITS OF ADDRESS OF PARITY ERROR:	>	;[544]
	POP	P,T1		;GET ADDRESS TO LIST BACK FROM STACK
	PUSHJ	P,.TOCTW	;[544]
	POPJ	P,0
	;END[543]
	SKIPN	P1		;IF ZERO, DONT BOTHER
	 POPJ	P,0
	TYPEIT	<
	11'S MEMORY STATUS REG:	>
	MOVE	T1,P1
	PUSHJ	P,.TOCTW	;IN OCTAL
	TYPEIT	< = >
	TRNN	P1,1B20		;PARITY ERROR?
	 JRST	R1%001		;NO
	TYPEIT	< PARITY ERROR >
R1%001:	TRNN	P1,1B35		;ENABLED?
	 JRST	R1%002		;NO?
	TYPEIT	< ENABLED >
R1%002:	TYPEIT	< ADDR:(HIGH 7 BITS) >
	LDB	T1,[POINT 7,P1,30]	;GET IT
	PUSHJ	P,.TOCTW
	POPJ	P,0
	;END [534]
	POPJ	P,0
;CHNSTS--ROUTINE TO LIST CHANNEL STATUS
;P2 HOLDS FIRST WORD,  DEPENDS ON IDENTICAL OFFSETS TO
;INFO AS ARE USED IN SEC%MB ENTRY FORMAT

CHNSTS:	TYPEIT	<
CHANNEL INFORMATION:
	CHAN STATUS WD 0:	>
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	TYPEIT	<	CW1:  >
	MOVE	T1,WKBUFF+MB%CC1	;1ST CCW
	PUSHJ	P,.TXWDW
	TYPEIT	<  CW2:  >
	MOVE	T1,WKBUFF+MB%CC2	;2ND CCW
	PUSHJ	P,.TXWDW
	TYPEIT	<
	CHN STATUS WD 1:	>
	MOVE	T1,WKBUFF+MB%CS1
	MOVE	P1,T1			;SAVE IT
	PUSHJ	P,.TXWDW
	MOVEI	T1,44			;CORRECT OFFSET
	MOVEM	T1,KONTYP		;FINISH SETUP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
	TYPEIT	<
	CHN STATUS WD 2:	>
	MOVE	T1,WKBUFF+MB%CS2
	PUSHJ	P,.TXWDW
	POPJ	P,0	;RETURN TO CALLER
	SUBTTL	MASBUSS SUBROUTINES

	;MB%000 ETC--	ROUTINES TO DO MOST OF THE WORK TO LIST
	;CODE 111 ENTRIES, MASSBUS DEVICE ERRORS.
	;DEVICE TYPE WORD IS IN P2 WHEN WE GET HERE
	;CALLED VIA PUSHJ FROM PROCSD RETURNS POPJ SEVERAL
	;PAGES FROM HERE.
	;CHANGED WITH [315] TO SUPPORT RP05 & RP06

MDE000:	SIXBIT/UNK/		; [1200]
	SIXBIT/RP04/		;THIS DEVICE NAME TABLE MUST BE KEPT
	SIXBIT/RS04/		; IN LINE WITH THE UNIT TYPE TABLE IN
	SIXBIT/TU45/		; THE UNIVERSAL FILE.  IN PARTICULAR
	SIXBIT/TU16/		; THERE MUST BE AT LEAST ".UTMAX" ITEMS
	SIXBIT/RP05/		; IN THE TABLE.
	SIXBIT/RP06/
	SIXBIT/RP07/		;RP07???
	SIXBIT/RP08/		;RP08???
	SIXBIT/RM03/		; [601]
	SIXBIT/TM03/
	SIXBIT/TU77/
	SIXBIT/TM78/
	SIXBIT/TU78/
	SIXBIT/DX20/		;[704]
	SIXBIT/TU70/
	SIXBIT/TU71/
	SIXBIT/TU72/		;END [704]
	SIXBIT/TU73/		;[1204]

RHTYP:	SIXBIT	/RH??/
	SIXBIT	/RH10/
	SIXBIT	/RH20/
	SIXBIT	/RH11/

;DISPATCH TABLE TO ROUTINES TO DECODE SURF/CYL/SECT OR FILE/RECORD
; LH = OFFSET IN TABLES FOR DSKPOS
; RH = TAPPOS FOR TAPES // DSKPOS FOR DISKS
;
;THIS TABLE MUST BE KEPT IN LINE WITH THE UNIT TYPE TABLE IN THE UNIVERSAL
; FILE.  IN PARTICULAR THERE MUST BE AT LEAST ".UTMAX" ITEMS IN THE TABLE.

BLTTAB:	0,,DUMPOS		;NONEXISTANT DEVICE  [1007]
	5,,DSKPOS		;RP04
	4,,DSKPOS		;RS04
	0,,TAPPOS		;TU45
	0,,TAPPOS		;TU16(TM02)
	6,,DSKPOS		;RP05
	7,,DSKPOS		;RP06
	0,,DSKPOS		;RP07
	0,,DSKPOS		;RP08
	10,,DSKPOS		;RM03
	0,,TAPPOS		;TM03
	0,,TAPPOS		;TU77
	0,,TAPPOS		;TM78
	0,,TAPPOS		;TU78
	0,,TAPPOS		;DX20
	0,,TAPPOS		;TU70
	0,,TAPPOS		;TU71
	0,,TAPPOS		;TU72
	0,,TAPPOS		;TU73
	;TYPE UNIT TYPE & S/N IF IT EXISTS

MB%000:	TYPEIT	<
	UNIT TYPE:	>
	MOVE P3,MDEDTP			;GET TYPE BACK
	MOVE	T1,MDE000(P3)		;GET IT IN SIXBIT
	PUSHJ	P,.TSIXN
	;NOW FOR SERIAL #
	MOVE	P2,WKBUFF+MB%REG+10	;LOCATION FOR RP04
	SKIPN	P2			;ANYTHING THERE?
	POPJ	P,0			;NO-LEAVE NOW
	TYPEIT	<
	UNIT SERIAL #:	>
	PJRST	DSERCD
	;HERE TO OUTPUT FAILURE LOCATION

MB%001:	MOVE T1,MDEDTP			;GET DEV TYPE BACK
	CAIN	T1,3			;MAGTAPE? - TU45?
	 JRST	.+3
	CAIE	T1,4			;TU16?
	 CAIN	T1,13			;TU77?
	  JRST MB%01C			;YUP
	
;HERE FOR LBN  (DISK)
	TYPEIT	<
	LBN AT START OF XFR:		>
	MOVE 	T1,WKBUFF+MB%LOC	;GET LBN
	PUSHJ	P,.TOCTW		;TYPE IN DECIMAL  [527]
	TYPEIT	<  =
	>
	MOVE	T1,MDEDTP		;GET TYPE AGAIN
	CAIN	T1,2			;RS04?
	 JRST	MB%01B			;YES! - BRANCH TO ROUTINE
	SETZ	P1,			;NO! - CLEAR INDEX POINTER [600]
	CAIN	T1,1			;RP04?
	 MOVEI	P1,5			;YES! - SET UP INDEX
	CAIN	T1,5			;RP05?
	 MOVEI	P1,6			;YES! - SET UP FOR RP05
	CAIN	T1,6			;RP06?
	 MOVEI	P1,7			;YES! - SET UP FOR RP06
	CAIN	T1,.UTRM3		;RM03?  [601]
	 MOVEI	P1,10			;YES!
	JUMPE	MB%01D			;RECOGNIZED DEVICE?  [600]
	MOVE	P3,WKBUFF+MB%LOC	;YES! - GET LBN
	CAMGE	P3,.MXBLK(P1)		;1ST UNIT OF STR?  [144]
	 JRST	MB%01A			;NO!
	SUB	P3,.MXBLK(P1)		;- 1 UNITS WORTH
	JRST	.-3			;AND TRY AGAIN
MB%01A:	TYPEIT	<CYL:   >
	IDIV	P3,.TRBLK(P1)		;GET CYL #
	MOVE	T1,P3
	PUSHJ	P,.ODECW		;SAY IT IN DECIMAL
	MOVE	P3,P4			;REMAINDER
	TYPEIT	<	SURF:   >
	IDIV	P3,.SUBLK(P1)		;SURFACE #
	MOVE	T1,P3
	PUSHJ	P,.ODECW		;AGAIN WITH ".".
	TYPEIT	<	SECT:   >
	MOVE	P3,P4			;REMAINDER
	IMUL	P3,.SECBK(P1)		;X SECTORS/BLOCK
	MOVE	T1,P3
	PUSHJ	P,.ODECW
	JRST	MB%01D			;GO AROUND MAGTAPE
	;HERE FOR LBN FOR RS04

MB%01B:	MOVE	P3,WKBUFF+MB%LOC	;GET LBN
	CAMGE	P3,.MXBLK+4		;[144]1ST UNIT IN STR?
	 JRST	.+3			;YES-OK
	SUB	P3,.MXBLK+4		;-1 UNITS WORTH
	JRST	.-3			;TRY AGAIN
	TYPEIT	<TRACK:   >
	IDIV	P3,.TRBLK+4		;GET TRK #
	MOVE	T1,P3
	PUSHJ	P,.ODECW		;SAY IT WITH FLOWERS
	MOVE	P3,P4			;REMAINDER
	TYPEIT	<	SECT:   >
	IMUL	P3,.SECBK+4		;GET SECTOR #
	MOVE	T1,P3
	PUSHJ	P,.ODECW
	JRST	MB%01D			;GO AROUND MAGTAPE

	;HERE FOR MAGTAPE FAILURE LOCATION
MB%01C:	TYPEIT	<
	LOCATION:    RECORD  #  >
	HRRZ	T1,WKBUFF+MB%LOC
	PUSHJ	P,.ODECW
	TYPEIT	<    OF FILE #  >
	HLRZ	T1,WKBUFF+MB%LOC
	PUSHJ	P,.ODECW
;NOW LIST USERS DIR AND PGM BUT ONLY FOT MAGTAPE
	MOVE P2,WKBUFF+MB%USR
	MOVEI	P1,[ASCIZ/
	USER'S LOGGED IN DIR:	/]
	PUSHJ	P,.PPNWT		;DO TRANS
	PUSHJ	P,.TCRLF
	MOVE	P2,WKBUFF+MB%PGM
	MOVEI	P1,[ASCIZ/	USER'S PGM:	/]
	PUSHJ	P,.SIXBT
	
;HERE AFTER DUMPING FAILURE LOCATION - NOW TO DUMP
	;OPERATION ISSUED TO DEVICE
MB%01D:	TYPEIT	<
	OPERATION AT ERROR:	>
	HRLZ	T1,WKBUFF+MB%ICR	;GET ISSUED CONTROL REG.
	MOVE	T2,MDEDTP		;SET UP INDEX
	PUSHJ	P,@MDE011(T2)		; LET ROUTINE DO WORK
	POPJ	P,0			;BACK TO PROCSD FOR A WHILE
;USE SAME ROUTINE FOR BOTH 111 & 112, VALUE IS IN P2

DX%004:
MB%004:	TYPEIT	<
	RETRIES PERFORMED:	>
	HRRZ	T1,P2			;MB%FEC / DX%FEC HAS RETRIES(?)
	PUSHJ	P,.ODECW
	POPJ	P,0

	;MB%CNI IS IN P2

MB%002:	TYPEIT	<
	ERROR:	>
	MOVEI	T1,[ASCIZ/RECOVERABLE /];ASSUME LUCK
	MOVE	T2,WKBUFF+MB%IRS	;GET STATUS WORD
	TLNE	T2,1B20			;HARD ERROR?
	 MOVEI	T1,[ASCIZ/NON-RECOVERABLE /]	;OPPS
	PUSHJ	P,.TSTRG
	MOVE	T1,MASKON		;KONTROLLER TYPE
	MOVEM	T1,KONTYP
	MOVE	P1,P2			;FINISH SETUP
	PUSHJ	P,CNIDCD		;GO DECODE
	MOVE	T1,MASKON		;GET CONTROLLER TYPE BACK
	CAIN	T1,..RH11		;RH11?  [600]
	 JRST	MB%02			;YES! - NO CONI - SKIP
	TYPEIT	< IN CONTROLLER CONI
		>
	JRST	MB%02A
MB%02:	TYPEIT	< IN CONTROLLER STATUS 1
		>
MB%02A:	HRLZ	P1,WKBUFF+MB%REG+2	;GET DEVICE'S ERROR REGISTER
	MOVEI	T1,21			;ASSUME RP04,5,6, OR RM03
	MOVE	T2,MDEDTP		;BUT CHECK
	CAIN	T2,3			;FOR TU45 OR
	 MOVEI	T1,27
	CAIN	T2,4			;OR TU16
	 MOVEI	T1,27
	CAIN	T2,13			;OR TU77
	 MOVEI	T1,27
	CAIN	T2,2			;OR RS04
	 MOVEI	T1,25
	MOVEM	T1,KONTYP		;FINISH SETUP
	PUSHJ	P,CNIDCD		;GO TRANSLATE
	TYPEIT	< IN DEVICE ERROR REGISTER>
	PUSHJ	P,.TCRLF
		PUSH	P,P1
	SETZ	P1,
	PUSHJ	P,DETCHK	;SAID /DETAIL?
	POP	P,P1
	TYPEIT	<CONTROLLER INFORMATION:
	CONTROLLER:	>
	MOVE	T2,MASKON		;GET CONTROLLER TYPE
	MOVE	T1,[SIXBIT/RH20 #/]	;ASSUME RH20
	CAIN	T2,..RH10		;BETTER CHECK - RH10?
	 MOVE	T1,[SIXBIT/RH10 #/]	;YES! - CHANGE TEXT
	CAIN	T2,..RH11		;RH11?  [600]
	 MOVE	T1,[SIXBIT/RH11 #/]	;YES! - CHANGE TEXT
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TSPAC
	MOVE	T1,WKBUFF+MB%CAD	;GET PHY ADDR
	PUSHJ	P,.TOCTW		;DUMP IN OCTAL
	MOVE	T1,MDEDTP		;GET DEVICE TYPE
	CAIE	T1,3			;MAGTAPE? - TU45?
	 CAIN	T1,4			;NO! - TU16?
	  PUSHJ	P,MB%02B		;YES! - LIST TM02/3 #
	MOVE	T1,MASKON		;GET CONTROLLER TYPE
	CAIN	T1,..RH11		;RH11?
	 JRST	MB%02C			;YES! - NO CONI - BRANCH
	;NOW DO CONI'S
	TYPEIT	<
	CONI AT ERROR:	>
	MOVE	T1,MASKON		;GET CONTROLLER TYPE
	MOVEM	T1,KONTYP
	MOVE	T1,WKBUFF+MB%CNI
	MOVE	P1,T1			;FINISH SETUP
	PUSHJ	P,.TXWDW		;IN HALF WORD FORMAT
	TYPEIT	< = >
	PUSHJ	P,CNIDCD		;GO DECODE
	TYPEIT	<
	CONI AT END:	>
	MOVE	T1,WKBUFF+MB%CIF
	MOVE	P1,T1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
	POPJ	P,0			;BACK TO PROCSD

;TM?? TYPE CHECKING IMPROVED WITH EDIT  [1227]

MB%02B:	HRRZ	T2,WKBUFF+MB%REG+6	;GET HDWR UNIT TYPE
	ANDI	T2,070			;ALONE
	MOVEI	T1,[ASCIZ/  TM?? #:  /]	;ASSUME WE DON'T KNOW TYPE
	CAIN	T2,10			;CHECK FOR TM02
	MOVEI	T1,[ASCIZ/  TM02 #:  /]
	CAIN	T2,50			;CHECK FOR TM03
	MOVEI	T1,[ASCIZ/  TM03 #:  /]
	PUSHJ	P,.TSTRG		;NOW LIST IT  [536]
	HRRZ	T1,WKBUFF+MB%UAD	;GET LOGICAL ADDRESS
	PUSHJ	P,.TOCTW		;LIST IN OCTAL
	POPJ	P,0			;RETURN

	;HANDLE RH11/UBA FOR 2020  - START EDIT  [600]

MB%02C:	MOVEI	T1,53			;C&S2 OFFSET
	MOVEM	T1,KONTYP		;SAVE IT
	TYPEIT	<
	RH11 STATUS 2 AT ERROR:	>
	MOVE	T1,WKBUFF+MB%S2I	;GET INITIAL RH11 STATUS 2
	MOVE	P1,T1
	PUSHJ	P,.TXWDW		;OUTPUT IN HALF WORDS
	TYPEIT	< = >
	PUSHJ	P,CNIDCD		;DECODE BITS
	TYPEIT	<
	RH11 STATUS 2 AT END:	>
	MOVE	T1,WKBUFF+MB%S2F	;GET FINAL RH11 STATUS 2
	MOVE	P1,T1
	PUSHJ	P,.TXWDW		;OUTPUT IN HALF WORDS
	TYPEIT	< = >
	PUSHJ	P,CNIDCD		;DECODE BITS
	MOVEI	T1,..UBA		;SET UP TO DECODE UBA STATUS
	MOVEM	T1,KONTYP
	TYPEIT	<
	UBA STATUS,MAP AT ERR:	>
	MOVE	T1,WKBUFF+MB%UBI	;GET INITIAL UBA STATUS
	MOVE	P1,T1
	PUSHJ	P,.TXWDW		;OUTPUT IN HALF WORDS
	TYPEIT	< = >
	PUSHJ	P,CNIDCD		;DECODE BITS
	TYPEIT	<
	UBA STATUS,MAP AT END:	>
	MOVE	T1,WKBUFF+MB%UBF	;GET FINAL UBA STATUS
	MOVE	P1,T1
	PUSHJ	P,.TXWDW		;OUTPUT IN HALF WORDS
	TYPEIT	< = >
	PUSHJ	P,CNIDCD		;DECODE BITS

	;NOW TO STOP USING PROCESS TABLE AND TAKE CONTROL OURSELF
	MOVE	P2,MB%CS0		;SET UP FOR CHANNEL STATUS
	PUSHJ	P,MB%003		;FINISH ENTRY
	JRST	ABORT			;DON'T GO BACK TO PROCESS TABLE!

	; END EDIT  [600]
	;MB%CS0 IS IN P2
MB%003:	PUSHJ	P,CHNSTS		;GO LIST CHANNEL STATUS INFO,P2 
					;IS ALREADY SET UP
;SETUP AND CALL ROUTINES TO DUMP 16 DEVICE REGISTERS

	TYPEIT	<
DEVICE REGISTER INFORMATION:
		AT ERROR	AT END		DIFF.		TEXT
>
	MOVE	T1,MDEDTP		;GET UNIT TYPE
	MOVE	P1,[XWD 1,20]		;SETUP P1 FOR MODE 1 AND 20 ITEMS
	CAIN	T1,3			;MAGTAPE? - TU45?
	 JRST 	.+3
	CAIE	T1,4			; TU16?
	 CAIN	T1,13			; TU77?
	  HRRI	P1,12			;CHANGE # OF ITEMS
	HRLZI	P2,MASREG		;STARTING ADDR OF TABLE
					; OF SIXBIT REG NAMES
	CAIN	T1,3			;MAGTAPE? - TU45?  [1243]
	 JRST 	.+3
	CAIE	T1,4			; TU16?
	 CAIN	T1,13			; TU77?
	  HRLI	P2,TU6REG		;CHANGE REGISTER NAMES
	CAIN	T1,.UTRM3		;RM03?  [601]
	 HRLI	P2,RM03RG		;YES! - SETUP FOR RM03 REGISTERS
	HRR	P2,MSCNTL(T1)		;SETUP P2
	MOVE	P3,[XWD MB%REG,MB%REG]	;WHERE TO FIND WORDS.
	PUSHJ	P,HWDUMP		;IF ALL GOES WELL
	PJRST	DEVSTS			;NOW GO LIST DEVICE STATISTICS
	;[EDIT 215]
	;NOW LIST DEVICE STATS AT TIME OF ERROR
	;DEVSTS IS CALLED FOR BOTH CODE 111 & 112 ENTRIES AND DEPENDS
	;ON IDENTICAL FORMATS AND LOCATIONS IN THE ERROR FILE ENTRY!!!

	;***********************
DEVSTS:	TYPEIT	<DEVICE STATISTICS AT TIME OF ERROR:
# OF READS:	>
	MOVE	T1,WKBUFF+MB%RED
	PUSHJ	P,.ODECW
	TYPEIT	<	# OF WRITES:	>
	MOVE	T1,WKBUFF+MB%WRT
	PUSHJ	P,.ODECW
	TYPEIT	<	# OF SEEKS:	>
	MOVE	T1,WKBUFF+MB%SEK
	PUSHJ	P,.ODECW
	TYPEIT	<
# SOFT READ ERRORS:	>
	MOVE	T1,WKBUFF+MB%SRE
	PUSHJ	P,.ODECW
	TYPEIT	<	# SOFT WRITE ERRORS:	>
	MOVE	T1,WKBUFF+MB%SWE
	PUSHJ	P,.ODECW
	TYPEIT	<
# HARD READ ERRORS:	>
	MOVE	T1,WKBUFF+MB%HRE
	PUSHJ	P,.ODECW
	TYPEIT	<	# HARD WRITE ERRORS:	>
	MOVE	T1,WKBUFF+MB%HWE
	PUSHJ	P,.ODECW
	TYPEIT	<
# SOFT POSITIONING ERRORS:	>
	MOVE	T1,WKBUFF+MB%SPE
	PUSHJ	P,.ODECW
	TYPEIT	<	# HARD POSITIONING ERRORS:	>
	MOVE	T1,WKBUFF+MB%HPE
	PUSHJ	P,.ODECW
	TYPEIT	<
# OF MPE:  >
	MOVE	T1,WKBUFF+MB%MPE
	PUSHJ	P,.ODECW
	TYPEIT	<   # OF NXM:  >
	MOVE	T1,MB%NXM
	PUSHJ	P,.ODECW
	TYPEIT	<   # OF OVERRUNS:  >
	MOVE	T1,WKBUFF+MB%OVR
	PUSHJ	P,.ODECW
	;END EDIT 215
	PUSHJ	P,TITLST	;EDIT 116 START ON NEXT PAGE
	POPJ	P,0		;WE'RE DONE!
	;EDIT [510]

	;DX%000 ETC--	ROUTINES TO DO MOST OF THE WORK TO LIST
	;CODE 112 ENTRIES, DX20 DEVICE ERRORS.
	;DEVICE TYPE WORD IS IN P2 WHEN WE GET HERE
	;CALLED VIA PUSHJ FROM PROCSD RETURNS POPJ SEVERAL
	;PAGES FROM HERE.


	;SETUP FOR SUB-BLOCK INDEX POINTERS


DX%000:	HRRZ	T3,WKBUFF+DX%MBR	;MASBUSS REG SUB-BLOCK POINTER
	ADDI	T3,WKBUFF		;CREATE BUFFER POINTER
	MOVEM	T3,SUBLK1		;SAVE IT
	HRRZ	T4,WKBUFF+DX%DVL	;DEVICE VALUE SUB-BLOCK POINTER
	ADDI	T4,WKBUFF		;CREATE BUFFER POINTER
	MOVEM	T4,SUBLK2		;SAVE IT

	;TYPE UNIT TYPE & S/N

	TYPEIT	<
	UNIT TYPE:	>
	MOVE	P3,MDEDTP		;GET TYPE BACK
	MOVE	T1,MDE000(P3)		;GET IT IN SIXBIT
	PUSHJ	P,.TSIXN

	;NOW FOR SERIAL #
	LDB	T1,[POINT 8,DT%SBE(T4),9]	;LOW PART
	LDB	T2,[POINT 8,DT%SBD(T4),35]	;HIGH PART
	DPB	T2,[POINT 8,T1,27]	;COMBINE HIGH & LOW PARTS
	SKIPN	T1			;ANYTHING THERE?
	 POPJ	P,0			;NO! - LEAVE
	PUSH	P,T1			;SAVE WHAT TO LIST
	TYPEIT	<
	UNIT SERIAL #:	>
	POP	P,T1			;RESTORE WHAT TO LIST
	PJRST	.ODECW			;OUTPUT IN DECIMAL


	;ROUTINE TO OUTPUT FAILURE LOCATION

DX%001:	MOVE	T1,MDEDTP		;GET DEV TYPE BACK
	;[704]
	CAIGE	T1,.UTDX2		;IN RANGE?
	 POPJ	P,0
	CAILE	T1,.UTT72
	 POPJ	P,0
	;END [704]
	TYPEIT	<
	LOCATION:    RECORD  #	>
	HRRZ	T1,WKBUFF+DX%LOC	;GET LOCATION WORD
	PUSHJ	P,.ODECW		;OUTPUT IN DECIMAL
	TYPEIT	<    OF FILE #	>
	HLRZ	T1,WKBUFF+DX%LOC	;GET FILE #  PART
	PUSHJ	P,.ODECW		;OUTPUT IN DECIMAL

	;NOW DUMP OPERATION ISSUED TO DEVICE

	TYPEIT	<
	OPERATION AT ERROR:	>
	HRLZ	T1,WKBUFF+DX%ICR	;GET ISSUED CONTROL REGISTER
	MOVE	T2,MDEDTP		;SETUP INDEX
	PJRST	@MDE011(T2)		; LET ROUTINE DO WORK
	;MORE EDIT [510]

	;ROUTINE TO TYPE OUT ERROR INFORMATION
	;ALSO OUTPUTS CONTROLLER CONI INFO IF /DETAIL  IS SET


DX%002:	TYPEIT	<
	ERROR:	>
	MOVEI	T1,[ASCIZ/RECOVERABLE /]	;ASSUME LUCK
	MOVE	T2,WKBUFF+DX%IRS	;GET STATUS WORD
	TLNE	T2,1B20			;HARD ERROR?
	 MOVEI	T1,[ASCIZ/NON-RECOVERABLE /]	;OPPS
	PUSHJ	P,.TSTRG
	MOVE	T1,MASKON		;KONTROLLER TYPE  (RH20)
	MOVEM	T1,KONTYP
	MOVE	P1,P2			;FINISH SETUP
	PUSHJ	P,CNIDCD		;GO DECODE
	TYPEIT	< IN CONTROLLER CONI
		>
	MOVE	T3,SUBLK1		;GET SUB-BLOCK POINTER
	HRLZ	P1,DM%ER(T3)		;GET DEVICE ERROR REGISTER
	MOVEI	T1,51			;BETTER BE TU70!!!
	MOVEM	T1,KONTYP		;FINISH SETUP
	PUSHJ	P,CNIDCD		;GO TRANSLATE
	TYPEIT	< IN DEVICE ERROR REGISTER>
	PUSHJ	P,.TCRLF
	PUSH	P,P1
	SETZ	P1,
	PUSHJ	P,DETCHK	;SAID /DETAIL?
	POP	P,P1
	TYPEIT	<CONTROLLER INFORMATION:
	CONTROLLER:	>
	MOVE	T2,MASKON		;GET CONTROLLER TYPE
	MOVE	T1,[SIXBIT/RH20 #/]	;ASSUME RH20
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TSPAC
	MOVE	T1,WKBUFF+DX%CAD	;GET PHY ADDR
	PUSHJ	P,.TOCTW		;DUMP IN OCTAL
	TYPEIT	<  DX20/>
	;START [716-RLD]
	HRRZ	T1,WKBUFF+DX%DVL	;GET PNTR
	MOVE	T2,WKBUFF+DT%SBC(T1)	;[721]GET SENSE BYTES 8-11
	MOVEI	T1,[ASCIZ/TX02  #:	/]	;ASSUME TX02
	TLNN	T2,1B32			;[721]REALLY BIT 14 SB.-9,B4
	 MOVEI	T1,[ASCIZ/TX01  #:	/]	;BETTER CHANGE
	PUSHJ	P,.TSTRG		;PRINT SOMETHING
	;END[716]
	HRRZ	T1,WKBUFF+DX%UAD	;GET LOGICAL ADDRESS
	PUSHJ	P,.TOCTW		;LIST IN OCTAL

	;START [716-RLD]
	TYPEIT	<
	DX20 U-CODE VERSION:	>
	LDB	T1,[POINT 6,WKBUFF+DX%VER,25]	;[720]GET VERSION #
	PUSHJ	P,.TOCTW
	TYPEIT	<(>
	LDB	T1,[POINT ^D10,WKBUFF+DX%VER,35]	;[720]AND EDIT #
	PUSHJ	P,.TOCTW
	TYPEIT	<)>
	;END [716-RLD]
	;NOW DO CONI'S
	TYPEIT	<
	CONI AT ERROR:	>
	MOVE	T1,MASKON		;GET CONTROLLER TYPE
	MOVEM	T1,KONTYP
	MOVE	T1,WKBUFF+DX%CNI
	MOVE	P1,T1			;FINISH SETUP
	PUSHJ	P,.TXWDW		;IN HALF WORD FORMAT
	TYPEIT	< = >
	PUSHJ	P,CNIDCD	;GO DECODE
	TYPEIT	<
	CONI AT END:	>
	MOVE	T1,WKBUFF+DX%CIF
	MOVE	P1,T1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
	POPJ	P,0			;BACK TO PROCSD

	;END EDIT [510]
;HERE LIST CHANNEL STATUS,MASSBUS INFO AND A WHOLE
;LOT OF DEVICE INFO.

DX%003:	PUSHJ	P,CHNSTS	;LIST CHANNEL TYPE, ETC
	;NOW LIST MASSBUS REGISTER VALUES 
	TYPEIT	<
MASSBUS REGISTER INFORMATION:
		AT ERROR	AT END		DIFF.		TEXT
>
	MOVE P1,[XWD 1,7]	;MODE 1,7 ITEMS TO LIST
	MOVE	P2,[XWD DX2REG,DX20CT]	;TABLE OF REGISTER NAMES,,CONTROL
					;TABLE ADDRESSES
	HRRZ	P3,WKBUFF+DX%MBR	;GET OFFSET TO BLOCK OF DATA
	HRL	P3,P3			;AT END & AT ERROR ARE AT SAME PLACE
	PUSHJ	P,HWDUMP		;GO DO THE LISTING
	MOVE	P1,[XWD 1,17]		;NOW DO SECOND HALF[714]
	MOVE	P2,[XWD DX2RG1,DX20C1]	;ADJUSTED CONTROL TABLES
	HRRZ	P3,WKBUFF+DX%MBR	;WHERE TO START
	ADDI	P3,DM%SI		;ADJUSTED FOR THOSE WE DID
	HRL	P3,P3
	PUSHJ	P,HWDUMP		;LIST THE REST OF 'EM
;NOW LIST THE DEVICE INFO, SENSE BYTES ETC
;FIRST RE-PACKAGE THE BYTES IN PLACE
	HRRZ	P1,WKBUFF+DX%DVL	;GET THE OFFSET
	ADDI	P1,WKBUFF
	MOVEI	T1,24			;A PASS COUNTER
DX%03A:	LDB	T2,[POINT 16,@P1,17]	;EXTRACT A 16 BIT BYTE  [1207]
	DPB	T2,[POINT 16,@P1,15]	;REPLACE IT
	LDB	T2,[POINT 16,@P1,35]	;EXTRACT ANOTHER 16 BIT BYTE
	DPB	T2,[POINT 16,@P1,31]	;REPLACE IT  (BITS 32-35 CONTAIN JUNK)
	AOS	P1			;BUMP THE POINTER
	SOJN	T1,DX%03A		;GET NEXT IF ANY

	;NOW USE HWDUMP TO LIST ALL THESE VALUES
	TYPEIT	<
DEVICE INFORMATION RECORDED AT TIME OF ERROR
	REGISTER  CONTENTS	TEXT
>
	MOVE	P1,[XWD 4,24]	;PRINT MODE 4,24 ITEMS
	MOVE	P2,[XWD DX2NAM,DX2CTL]
	HRLZ	P3,WKBUFF+DX%DVL	;OFFSET TO AT ERROR VALUES
	PUSHJ	P,HWDUMP
	;NOW FINALLY LIST DEVICE STATISTICS
	PJRST	DEVSTS			;WILL RETURN TO PROCSD
	;HERE ARE REGISTER NAMES AND CONTROL TABLES FOR HWDUMP
	;USED WITH DX20 ENTRIES

DX2REG:	SIXBIT/CR(00)/
	SIXBIT/SR(01)/
	SIXBIT/ER(02)/
	SIXBIT/MR(03)/
	SIXBIT/AS(04)/
	SIXBIT/SB(05)/
	SIXBIT/DT(06)/
DX2RG1:	SIXBIT/SI(20)/
	SIXBIT/DN(21)/
	SIXBIT/ES(22)/
	SIXBIT/TE(23)/
	SIXBIT/AY(24)/
;;;;;	SIXBIT/BC(25)/;;;;REMOVED BY EDIT 714[RLD]
	SIXBIT/E0(26)/
	SIXBIT/E1(27)/
	SIXBIT/IR(30)/
	SIXBIT/PC(31)/
	SIXBIT/AL(32)/
	SIXBIT/SD(33)/
	SIXBIT/FP(34)/
	SIXBIT/BW(35)/
	SIXBIT/IB(36)/
	SIXBIT/MA(37)/
	;NOW THE CONTROL TABLE FOR THE MASSBUS VALUES
DX20CT:	XWD -1,DX20CR
	XWD 50,DXSRDV
	XWD -1,DX20ER
	XWD 52,DXMRDV
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,DX20DT
DX20C1:	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	;NOW THE SECOND SET
DX2NAM:	SIXBIT/SB 0-3/
	SIXBIT/   4-7/
	SIXBIT/  8-11/
	SIXBIT/ 12-15/
	SIXBIT/ 16-19/
	SIXBIT/ 20-23/
	SIXBIT/  MCV /
	SIXBIT/  MRA /
	SIXBIT/  MRB /
	SIXBIT/  MRC /
	SIXBIT/  MRD /
	SIXBIT/  MRE /
	SIXBIT/  MRF /
	SIXBIT/  CB0 /
	SIXBIT/  CB1 /
	SIXBIT/  DP0 /
	SIXBIT/  DP1 /
	SIXBIT/  DP2 /
	SIXBIT/  DP3 /
	SIXBIT/  LAS /
	;NOW THE CONTROL TABLE
;FOR NOW ALL ARE "NOTRAN"
DX2CTL: XWD -1,T7SB0S
	XWD -1,DXSB4S
	XWD 36,SB81DV
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
	XWD -1,NOTRAN
DX2FUN:	[ASCIZ/ NO OPERATION(00)/]
	[ASCIZ/ REWIND & UNLOAD(02)/]
	[ASCIZ/ ILLEGAL04)/]
	[ASCIZ/ REWIND(06)/]
	[ASCIZ/ DRIVE CLEAR(10)/]
	[ASCIZ/ SENSE RELEASE(12)/]
	[ASCIZ/ ILLEGAL(14)/]
	[ASCIZ/ ILLEGAL(16)/]
	[ASCIZ/ ILLEGAL(20)/]
	[ASCIZ/ ILLEGAL(22)/]
	[ASCIZ/ ERASE GAP(24)/]
	[ASCIZ/ WRITE TAPE MARK(26)/]
	[ASCIZ/ SPACE REC FORWARD(30)/]
	[ASCIZ/ SPACE REC BACK(32)/]
	[ASCIZ/ SPACE BLOCK FORWARD(34)/]
	[ASCIZ/ SPACE BLOCK BACK(36)/]
	[ASCIZ/ TEST I-O(40)/]
	[ASCIZ/ DATA SEC ERASE(42)/]
	[ASCIZ/ SENSE(44)/]
	[ASCIZ/ SENSE RESERVE(46)/]
	[ASCIZ/ ILLEGAL(50)/]
	[ASCIZ/ ILLEGAL(52)/]
	[ASCIZ/ ILLEGAL(54)/]
	[ASCIZ/ ILLEGAL(56)/]
	[ASCIZ/ WRITE DATA(60)/]
	[ASCIZ/ WRITE DIAGNOSTIC(62)/]
	[ASCIZ/ LOOP WRITE TO READ(64)/]
	[ASCIZ/ ILLEGAL(66)/]
	[ASCIZ/ READ DATA(70)/]
	[ASCIZ/ ILLEGAL(72)/]
	[ASCIZ/ READ EXTENDED STATUS(74)/]
	[ASCIZ/ READ REVERSE(76)/]
	;NOW THE SPECIAL DECODING ROUTINES CALLED FROM THE CONTROL TABLES
	;T1 HAS WORD TO TRANSLATE AND P1 MUST BE PRESERVED*****

DX20CR:	PUSH	P,P1		;SAVE P1
	HLRZ	P1,T1		;ONLY WORRY ABOUT 'AT ERROR' VALUE
	TRNN	P1,1B35		;GO?
	 JRST	.+3
	TYPEIT	< GO + >
	ANDI	P1,76		;GET FUNCTION BITS ALONE
	LSH	P1,-1		;RIGHT JUSTIF FOR AN INDEX
	HRRZ	T1,DX2FUN(P1)	;GET THE ADDR OF THE ASCIZ
	PUSHJ	P,.TSTRG
	POP	P,P1		;RESTORE P1
	POPJ	P,0

DX20ER:	PUSH	P,P1
	MOVE	P1,T1
	PUSH	P,P1		;NOW SAVE THE ERROR WORD
	MOVEI	T1,51		;OFFSET INTO TABLES
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD	;DO 1 FOR 1 X-LATION FIRST
	POP	P,P1		;RESTORE ERROR WORD
	TLNE	P1,1B28		;IF NOT SET, LEAVE NOW
	 JRST	.+3		;SET, MORE LISTING REQ'D
	POP	P,P1		;RESTORE P1
	POPJ	P,0		;AND LEAVE
	TYPEIT	<MPERR CLASS: >
	LDB	P2,[POINT 4,P1,9] ;GET CLASS CODE
	MOVE	T1,P2
	PUSHJ	P,.TOCTW
	TYPEIT	< ,SUB-CLASS: >
	LDB	P3,[POINT 4,P1,5]	;AND SUB-CLASS
	MOVE	T1,P3
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	TYPEIT	< = >
	CAMLE	P2,MPCLS	;CHECK FOR MAX # OF CLASSES WE RECOGNIZE
	 JRST	DX2ER0		;OUT OF RANGE
	;NOW CHECK FOR SUB-CLASS RANGE
	MOVE T1,MPCLS(P2)	;T1 GETS BASE ADDR OF SUB-CLASS TABLE
	MOVE	T2,-1(T1)	;RANGE FOR THIS SUB-CLASS
	CAMLE	P3,T2		;OK?
	 JRST	DX2ER1		;NOPE
	ADD	T1,P3		;OK-GET ADDR OF ASCIZ TEXT
	MOVE	T1,0(T1)	;AND ADDRESS
	PUSHJ	P,.TSTRG
	POP	P,P1		;NOW RESTORE P1
	POPJ	P,0

DX2ER0:	TYPEIT	< UNKNOWN MPERR CLASS >
	POP	P,P1
	POPJ	P,0
DX2ER1:	TYPEIT	< UNKNOWN MPERR SUB-CLASS>
	POP	P,P1
	POPJ	P,0
;HERE ARE SUB TABLES AND TEXT ADDRS
;FIRST IS TABLE OF CLASSES,EACH ITEM POINTS TO SUB-CLASS TABLE

MPCLS:	^D8			;CURRENT # OF CLASSES RECOGNIZED
	XWD 0,MPCLS1
	XWD 0,MPCLS2
	XWD 0,MPCLS3
	XWD 0,MPCLS4
	XWD 0,MPCLS5
	XWD 0,MPCLS6
	XWD 0,MPCLS7
	XWD 0,MPCL10

	XWD 0,1			;CURRENT # OF SUB-CLASS ARGUEMENTS
MPCLS1:	[ASCIZ/ UNUSUAL DEVICE STATUS FROM FINAL STATUS SEQUENCE/]
	[ASCIZ/ UNUSUAL DEVICE STATUS FROM INITIAL STATUS SEQUENCE/]

	XWD 0,0			;CURRENT #
MPCLS2:	[ASCIZ/ SHORT RECORD/]

	XWD 0,0
MPCLS3:	[ASCIZ/ LONG RECORD/]

	XWD 0,0
MPCLS4:	[ASCIZ/ DRIVE SELECTION ERROR, NON-EXISTENT/]

	XWD 0,0
MPCLS5:	[ASCIZ/ RECOVERABLE ERROR-TAPE MOTION-  DATA PARITY ERROR/]

	XWD 0,2
MPCLS6:	[ASCIZ/ RECOVERABLE ERROR-NO TAPE MOTION- DRIVE ADDR. MISMATCH/]
	[ASCIZ/ RECOVERABLE ERROR-NO TAPE MOTION- BUS IN PAR ERR WHILE RECEIVING DRIVE ADDR/]
	[ASCIZ/ RECOVERABLE ERROR-NO TAPE MOTION- BUS IN PAR ERR WHILE RECEIVING INITIAL STATUS/]

	XWD 0,1
MPCLS7:	[ASCIZ/ NON-RECOVERABLE ERROR, DATA PATH DETECTED U-BUS PAR ERR/]
	[ASCIZ/ NON-RECOVERABLE ERROR, CHANNEL BUS DETECTED U-BUS PAR ERR/]

	XWD 0,2
MPCL10:	[ASCIZ/ FATAL ERROR, DRIVE TYPE MISMATCH/]
	[ASCIZ/ FATAL ERROR, PAR ERR RECEIVING DRIVE ADDR DURING C.U. INIT SEQ/]
	[ASCIZ/ FATAL ERROR, PAR ERR RECEIVING DRIVE STATUS DURING  C.U. INIT SEQ/]
	;HERE DECODE DX20 DRIVE TYPE REGISTER

DX20DT:	PUSH	P,P1
	MOVE	P1,T1		;SAVE WORD TO TRANSLATE
	TYPEIT	< DRIVE TYPE: >
	LDB	T1,[POINT 9,P1,17]	;EXTRACT DRIVE TYPE
	PUSHJ	P,.TOCTW
	;ADD CODE HERE TO TRANSLATE TO TYPE
	TYPEIT	<, HDWR VER: >
	LDB	T1,[POINT 7,P1,8]	;EXTRACT VERSION #
	PUSHJ	P,.TOCTW
	POP	P,P1
	POPJ	P,0
	;SOME TABLES AND ROUTINES USED WITH MASBUSS ENTRIES
	;FIRST THE TABLE OF SIXBIT REGISTER NAMES
	;CHANGED TO FIT TRAINING'S REQUIREMENTS WITH VER 3C.
MASREG:	SIXBIT/CR(00)/		;CONTROL & STATUS #1
	SIXBIT/SR(01)/		;DRIVE STATUS
	SIXBIT/ER(02)/		;ERROR REGISTER #1
	SIXBIT/MR(03)/		;MAINTENANCE REGISTER
	SIXBIT/AS(04)/		;ATTENTION SUMMARY
	SIXBIT/DA(05)/		;DESIRED SECTOR/TRACK ADDRESS
	SIXBIT/DT(06)/		;DRIVE TYPE
	SIXBIT/LA(07)/		;LOOK-AHEAD
	SIXBIT/SN(10)/		;SERIAL NUMBER
	SIXBIT/OF(11)/		;OFFSET
	SIXBIT/DC(12)/		;DESIRED CYLINDER
	SIXBIT/CC(13)/		;CURRENT CYLINDER
	SIXBIT/E2(14)/		;ERROR REGISTER #2
	SIXBIT/E3(15)/		;ERROR REGISTER #3
	SIXBIT/EP(16)/		;ECC POSITION REGISTER
	SIXBIT/PL(17)/		;ECC PATTERN REGISTER

RM03RG:	SIXBIT/CS1 00/		;CONTROL & STATUS #1
	SIXBIT/DS  01/		;DRIVE STATUS
	SIXBIT/ER1 02/		;ERROR REGISTER #1
	SIXBIT/MR1 03/		;MAINTENANCE REGISTER #1
	SIXBIT/AS  04/		;ATTENTION SUMMARY
	SIXBIT/DA  05/		;DESIRED SECTOR/TRACK ADDRESS
	SIXBIT/DT  06/		;DRIVE TYPE
	SIXBIT/LA  07/		;LOOK AHEAD
	SIXBIT/SN  10/		;SERIAL NUMBER
	SIXBIT/OF  11/		;OFFSET
	SIXBIT/DC  12/		;DESIRED CYLINDER
	SIXBIT/HR  13/		;**HOLDING REGISTER**
	SIXBIT/MR2 14/		;MAINTENANCE REGISTER #2
	SIXBIT/ER2 15/		;ERROR REGISTER #2
	SIXBIT/EC1 16/		;ECC POSITION REGISTER
	SIXBIT/EC2 17/		;ECC PATTERN REGISTER
;NOW THE CONTROL TABLE ADDRESSES

;THIS TABLE MUST BE KEPT IN LINE WITH THE UNIT TYPE TABLE IN THE UNIVERSAL
; FILE.  IN PARTICULAR THERE MUST BE AT LEAST ".UTMAX" ITEMS IN THE TABLE.

MSCNTL:	0
	XWD	0,RP04CT	;RP04
	XWD	0,RS04CT	;RS04
	XWD	0,TU16CT	;TU45
	XWD	0,TU16CT	;TU16
	XWD	0,RP05CT	;RP05
	XWD	0,RP05CT	;RP06  [315]
	XWD	0,DX20CT	;TU70  (REG. 0-6)
	XWD	0,DX20C1	; TU70  (REG. 20-37)
	XWD	0,RM03CT	;RM03  [601]
		0
	XWD	0,TU16CT	;TU77  [1243]



	;SIXBIT REGISTER NAMES FOR TU16
TU6REG:	SIXBIT/CR(00)/
	SIXBIT/SR(01)/
	SIXBIT/ER(02)/
	SIXBIT/MR(03)/
	SIXBIT/AS(04)/
	SIXBIT/FC(05)/
	SIXBIT/DT(06)/
	SIXBIT/CK(07)/
	SIXBIT/SN(10)/
	SIXBIT/TC(11)/
;SPECIAL ROUTINES TO DECODE TU70 SENSE BYTES, COPIED FROM
;SYSERB.MAC

T7SB0S:	PUSH	P,P1		;SAVE OUR INDEX
	MOVEI	T1,32		;OFFSET FOR SENSE BYTES 0-3
	MOVEM	T1,KONTYP
	MOVE	P1,P2		;WORD TO DECODE
	PUSH	P,P2
	PUSHJ	P,CNIDCD
	POP	P,P2		;RESTORE WORD TO TRANSLATE
	TYPEIT	< TIE = >
	LDB	P3,[POINT 8,P2,23] 	;TRACK IN ERROR
	SETZ	T1,
	TRNE	P3,1B28
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	SETZ	T1,
	TRNE	P3,1B29
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	SETZ	T1,
	TRNE	P3,1B30
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	SETZ	T1,
	TRNE	P3,1B31
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	SETZ	T1,
	TRNE	P3,1B32
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	SETZ	T1,
	TRNE	P3,1B33
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	SETZ	T1,
	TRNE	P3,1B34
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	SETZ	T1,
	TRNE	P3,1B35
	 MOVEI	T1,1
	PUSHJ	P,.TOCTW
	POP	P,P1		;GET INDEX BBACK
	POPJ	P,0		;GO HOME
;HERE SPECIAL DECODING FOR TU70/72 SENSE BYTES 4-7

DXSB4S:	PUSH	P,P1		;SAVE INDEX
	MOVEI	T1,33			;OFFSET TO TABLES
	MOVEM	T1,KONTYP
	MOVE	P1,P2		;WOD TO TRANSLATE
	PUSH	P,P2		;SAVE IT
	PUSHJ	P,CNIDCD		;TRANSLATE IT
	POP	P,P2		;GET WORD BACK
	LDB	P3,[POINT 3,P2,26]	;COLUMN FAILURES
	SKIPE	P3		;ANY THERE?
	 JRST	DXSB4A		;YES
	POP	P,P1
	POPJ	P,0
DXSB4A:	PUSHJ	P,.TSPAC
	MOVE	P2,P3
	ANDI	P3,3		;GET COL BITS ALONE
	CAIN	P3,1
	 MOVEI	T1,[ASCIZ/RIGHT/]
	CAIN	P3,2
	 MOVEI	T1,[ASCIZ/LEFT/]
	CAIN	P3,3
	MOVEI	T1,[ASCIZ/BOTH/]
	PUSHJ	P,.TSTRG
	TYPEIT	< COL.FAIL >
	MOVEI	T1,[ASCIZ/TOP/]
	TRNE	P2,4			;TOP OR BOTTOM?
	 MOVEI	T1,[ASCIZ/BOTTOM/]
	PUSHJ	P,.TSTRG
	POP	P,P1		;GET INDEX BACK
	POPJ	P,0
;ROUTINES TO TRANSLATE MASSBUS DEVICE REG. AS SPECIAL ROUTINES
;T1 HAS WORD TO TRANSLATE

;THIS TABLE MUST BE KEPT IN LINE WITH THE UNIT TYPE TABLE IN THE UNIVERSAL
; FILE.  IN PARTICULAR THERE MUST BE AT LEAST ".UTMAX" ITEMS IN THE TABLE.
;MODIFIED WITH [704] TO SUPPORT .UTDX20-.UTT72

MDE011:	XWD	0,DUMCR		;NOT USED
	XWD	0,RP04CR	;RP04
	XWD	0,RS04CR	;RS04
	XWD	0,TU16CR	;TU45
	XWD	0,TU16CR	;TU16 (TM02)
	XWD	0,RP04CR	;RP05
	XWD	0,RP04CR	;RP06
	XWD	0,DUMCR		;RP07
	XWD	0,DUMCR		;RP08
	XWD	0,RP04CR	;RM03
	XWD	0,DUMCR		;TM03
	XWD	0,TU16CR	;TU77
	XWD	0,DUMCR		;TM78
	XWD	0,DUMCR		;TU78
	XWD	0,DX20CR	;DX20
	XWD	0,DX20CR	;TU70
	XWD	0,DX20CR	;TU71
	XWD	0,DX20CR	;TU72
	XWD	0,DX20CR	;TU73
RS04CR:	HLRZ	P4,T1		;SAVE ERROR WORD
	TRNN	P4,1B24		;AVAIL?
	 JRST	.+3		;NO
	TYPEIT	<DEV.AVAIL.,>
	TRNN	P4,1B35		;GO?
	 JRST	.+3		;NO
	TYPEIT	< GO + >
	ANDI	P4,70		;GET FUNCTION
	LSH	P4,-3		;MOVE IT OVER FOR INDEX
	HRRZ	T1,RS4FUN(P4)	;GET FUNCTION ASCIZ ADDR
	PJRST	.TSTRG		;DUMP IT

RP04CR:	HLRZ	P4,T1	;GET WORD
	TRNN	P4,1B24			;AVAIL?
	 JRST 	.+3			;NO
	TYPEIT	< DEV.AVAIL.,>
	TRNN	P4,1B35			;GO?
	 JRST	.+3
	TYPEIT	< GO + >
	ANDI	P4,76			;GET FUNCTION
	LSH	P4,-1			;STRIP GO BIT
	HRRZ	T1,RP4FUN(P4)		;SETUP FUNCT.ASCIZ ADDR
	PJRST	.TSTRG			;SAY IT

TU16CR:	HLRZ	P4,T1
	TRNN	P4,1B24		;AVAIL?
	 JRST	.+3		;NO
	TYPEIT	< DEV.AVAIL. >
	TRNN	P4,1B35		;GO?
	 JRST	.+3
	TYPEIT	< GO + >
	ANDI	P4,76		;GET FUNCTION
	LSH	P4,-1		;SETUP INDEX
	HRRZ	T1,TU6FUN(P4)	;USE IT
	PJRST	.TSTRG


DUMCR:	POPJ	P,0		;FILLER FOR HOLES IN TABLE
	;SOME TABLES
RS4FUN:	[ASCIZ/ NO OPERATION(00)/]
	[ASCIZ/ DRIVE CLEAR(02)/]
	[ASCIZ/	ILLEGAL(04)/]
	[ASCIZ/ SEARCH(06)/]
	[ASCIZ/ ILLEGAL(10)/]
	[ASCIZ/ ILLEGAL(12)/]
	[ASCIZ/ WRITE(14)/]
	[ASCIZ/ READ(16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Z/ WRITE FILEMARK(26)/]
	[ASCIZ/ SPACE FWD.(30)/]
	[ASCIZ/ SPACE REV.(32)/]
	[ASCIZ/ ILLEGAL(34)/]
	[ASCIZ/ ILLEGAL(36)/]
	[ASCIZ/ ILLEGAL(40)/]
	[ASCIZ/ ILLEGAL(42)/]
	[ASCIZ/ ILLEGAL(44)/]
	[ASCIZ/ ILLEGAL(46)/]
	[ASCIZ/ WRITE CHECK FWD.(50)/]
	[ASCIZ/ ILLEGAL(52)/]
	[ASCIZ/ ILLEGAL(54)/]
	[ASCIZ/ WRITE CHECK REV.(56)/]
	[ASCIZ/ WRITE FWD.(60)/]
	[ASCIZ/ ILLEGAL(62)/]
	[ASCIZ/ ILLEGAL(64)/]
	[ASCIZ/ ILLEGAL(66)/]
	[ASCIZ/ READ FWD.(70)/]
	[ASCIZ/ ILLEGAL(72)/]
	[ASCIZ/ ILLEGAL(74)/]
	[ASCIZ/ READ REV.(76)/]

	;SOME ROUTINES TO DUMP SOME PARTICULAR REGISTERS.
	;CALLED FROM HWDUMP  FIRST TO OUTPUT DESIRED
	;SECTOR/TRACK FOR RP04

RP04BA:	HLRZ	P4,T1		;GET ERROR WORD ALONE

	MOVE	P3,P4
	ANDI	P3,17400	;MASK TO GET TRACK ALONE
	LSH	P3,-^D8		;MOVE IT OVER
	TYPEIT	<D. TRK = >
	MOVE 	T1,P3
	PUSHJ	P,.TOCTW	;PRINT IT
	TYPEIT	<, D.SECT. = >
	ANDI	P4,37		;GET SECTOR
	MOVE 	T1,P4
	PJRST	.TOCTW	;DO IT

	;TO DUMP RM03 OFFSET REG.
RM03MO:	HRRZ	P4,T1
	TYPEIT	<AT END:>
	TRNE	P4,1B23		;FORMAT BIT ?
	 JRST [	TYPEIT	<FMT16,>
		JRST	.+1 ]
	TRNE	P4,1B24		;ECI ON?
	 PUSHJ	P,RPMO02
	TRNE	P4,1B25		;HCI?
	 PUSHJ	P,RPMO03
	TRNE	P4,1B28		;OFD ON?
	 JRST [	TYPEIT	<OFD>
		JRST	.+1 ]
	POPJ	P,0

	;TO DUMP RP04 OFFSET REG.
RP04MO:	HRRZ	P4,T1
	TYPEIT	<AT END:>
	TRNN	P4,1B20		;SIGN CHANGE?
	 PUSHJ	P,RPMO00	;YUP SAY SO
	TRNE	P4,1B23		;FORMAT BIT ?
	 PUSHJ	P,RPMO01
	TRNE	P4,1B24		;ECI ON?
	 PUSHJ	P,RPMO02
	TRNE	P4,1B25		;HCI?
	 PUSHJ	P,RPMO03
	TYPEIT	< OFFSET = >
	TRNE	P4,1B28		;NEGATIVE DIR.?
	 PUSHJ	P,RPMO04		;YES
	SETZ	P3,		;ZERO COUNTER
	TRNE	P4,1B30		;800?
	 ADDI	P3,^D800
	TRNE	P4,1B31		;400?
	 ADDI	P3,^D400
	TRNE	P4,1B32		;200?
	 ADDI	P3,^D200
	TRNE	P4,1B33		;100?
	 ADDI	P3,^D100
	TRNE	P4,1B34		;50?
	 ADDI	P3,^D50
	TRNE	P4,1B35		;25?
	 ADDI	P3,^D25
	MOVE	T1,P3		;TOTAL IN T1 NOW
	MOVE T2,MDETYP		;[525]GET DEVICE TYPE
	CAIN	T2,6		;RP06?
	IDIVI	T1,2		;OFFSETS ARE HALF AS BIG[525]
	SKIPN	T1		;NO OFFSET?
	 PJRST	RP04M1		;YUP-NONE
	PUSHJ	P,.ODECW	;PRINT WITH A "."
	TYPEIT	< U IN.>
	POPJ	P,0		;GO HOME

RP04M1:	TYPEIT	<NONE>
	POPJ	P,0
RPMO00:	TYPEIT	<SIGN CHANGE OFF,>
	POPJ	P,0
RPMO01:	TYPEIT	<FMT22,>
	POPJ	P,0
RPMO02:	TYPEIT	<ECI,>
	POPJ	P,0
RPMO03:	TYPEIT	<HCI,>
	POPJ	P,0
RPMO04:	TYPEIT	< - >
	POPJ	P,0

	;NOW FOR RP04 DESIRED OR CURRENT CYL

RP04DC:	HLRZ	T1,T1		;GET ERROR ALONE
	ANDI	T1,1777		;[505]ONLY CYL BITS WANTED
	MOVE	T2,MDEDTP	;[527][315]GET DEVICE TYPE
	CAIN	T2,6		;RP06?
	 JRST	RP4DC1		;[1270] YES
	CAIN	T2,11		;[1270] RM03 ?
	 JRST	RP4DC1		;[1270] YES
	TRZ	T1,1000		;[505]NO-CLEAR EXTRA BIT
RP4DC1:	PJRST	.ODECW		;[1270]
	;RS04 DESIRED SECTOR/TRACK ADDRESS
RS04BA:	HLRZ	P4,T1
	MOVE	P3,P4
	ANDI	P3,7700		;TRACK BITS ONLY
	LSH	P3,-6		;MOVE IT OVER
	TYPEIT	<D. TRK = >
	MOVE	T1,P3
	PUSHJ	P,.TOCTW
	TYPEIT	<, D.SECT = >
	ANDI	P4,77		;SECTOR BITS
	MOVE	T1,P4
	PJRST	.TOCTW


	;NOW FOR TU16 REGISTERS

TU16TC:	HLRZ	P4,T1
	TRNN	P4,1B20
	 JRST 	.+3
	TYPEIT	<ACCL,>
	TRNN	P4,1B21
	 JRST	.+3
	TYPEIT	< FCS,>		; [1153]
	TRNN	P4,1B22
	 JRST	.+3
	TYPEIT	< TCW,>		; [1153]
	TRNN	P4,1B23
	 JRST	.+3
	TYPEIT	< EAO/DTE,>
	MOVE	P3,P4
	ANDI	P3,3400		;GET DENSITY
	LSH	P3,-10
	MOVE	T1,TU6DEN(P3)
	PUSHJ	P,.TSTRG
	MOVE	P3,P4
	ANDI	P3,360		;GET FORMAT
	LSH	P3,-4
	MOVE	T1,TU6FOR(P3)
	PUSHJ	P,.TSTRG
	TRNN	P4,1B32
	 JRST	.+3
	TYPEIT	< EVEN PARITY>
	ANDI	P4,7		;GET SLAVE #
	TYPEIT	< SLAVE #>
	MOVE	T1,P4
	PJRST	.TOCTW

TU6DEN:	[ASCIZ/ 200BPI NRZ/]
	[ASCIZ/ 556BPI NRZ/]
	[ASCIZ/ 800BPI NRZ/]
	[ASCIZ/ 800BPI NRZ/]
	[ASCIZ/ 1600BPI PE/]
	[ASCIZ/ 1600BPI PE/]
	[ASCIZ/ 1600BPI PE/]
	[ASCIZ/ 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SBD ;OFFSET > 77 -- PROCESSOR CAN'T GET IT [753]
	PUSHJ	P,SBDOUT
	POPJ	P,0

;MOVED KLE200 & KLE201 TO SYRLIB WITH EDIT [1226]
	SUBTTL	BIT CHECKING 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
	;CHANGED WITH EDIT 211 TO SUPPORT USING ONLY /DEV:SWITCH

BCK101:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM101	;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC101A		;NO GO AROUND
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV		;MATCH?
	 JRST	ABORT		;NOPE!
	TLNE	F,F.OSUM	;ANY TYPE SWITCH SPECIFIED?
	 TLO	P2,E.LALL	;NO FORCE LISTING
BC101A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPER	;LIST PERFORMANCE
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
BCK102:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM102		;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC102A		;NO GO AROUND
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV		;MATCH?
	 JRST	ABORT		;NOPE!
	TLNE	F,F.OSUM	;ANY TYPE SWITCH SPECIFIED?
	 TLO	P2,E.LALL	;NO FORCE LISTING
BC102A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPER	;LIST PERFORMANCE
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
BCK111:	MOVE	P1,ERTYPE
	MOVE	P4,ENTCHR(P1)		;GET CHAR WORD
	PUSH	P,P4			;SAVE CHARACTERISTICS
	TLNE	P4,E.LSUM		;SUMMARY?
	 PUSHJ	P,SUM111
	TLNN	F,F.TRY			;SAID /RETRY?  [126]
	 JRST	BC111A			;NO
	HRRZ	T1,WKBUFF+MB%FEC	;[707]GET # RETRIES
	CAMG	T1,RETRY		;ENTRY VALUE GREATER
	 JRST	ABORT			;NO-DON'T LIST
BC111A:	TLNN	F,F.DEV			;SAID /DEV:?
	 JRST	BK111B			;NO! - SKIP THIS SECTION
	MOVE	T1,DEV			;YES! - GET SPECIFIED NAME
	MOVE	T2,MDEDTP		;GET THIS ENTRIES DEVICE TYPE
	CAMN	T1,MDE000(T2)		;ARE THEY THE SAME?  [606]
	 JRST	.+3			;YES! - FORCE LISTING
	MOVEI	P3,MB%NAM		;NO! - TRY GENERAL TYPE
	PUSHJ	P,DEVCHK
	POP	P,P4			;GET CHARACTERISTICS BACK
	TLNE	F,F.OSUM	;ANY TYPE SWITCH CALLED LIKE /MASALL?
	 TLO	P4,E.LALL	;NO-FORCE LISTING
	PUSH	P,P4		;SAVE CHARACTERISTICS
BK111B:	TRNN	F,F.NDEV	;/NDEV:?
	 JRST	BC111B		;NOPE
	MOVEI	P3,MB%NAM
	PUSHJ	P,NDVCHK	;GO CHECK
BC111B:	TLNN	F,F.ID			;SAID /ID:?
	 JRST	BC111C
	MOVEI	P3,MB%VID
	PUSHJ	P,IDCHK
BC111C:	TLNN	F,F.STR		;SAID /STR?
	 JRST BC111X		;NO
	MOVEI	P3,MB%VID	;OFFSET TO STR ID(USES VID,REALLY)
	PUSHJ	P,STRCHK	;GO CHECK IT
BC111X:	POP	P,P4		;GET CHARACTERISTICS BACK
	TLNE	P4,E.LALL		;WANTS ALL?
	 POPJ	P,0			;OK
	TLNN	P4,E.LNXM		;HOW ABOUT NXM
	 JRST	BC111E			;NO-CHECK PARITY
	HRRZ	T1,MASKON	;GET CONTROLLER TYPE
	CAIE	T1,..RH10		;RH10?
	 JRST	BC111D			;NO
	MOVE 	T2,WKBUFF+MB%CNI	;YES-GET CONI WORD
	TLNE	T2,1B35			;NXM ON?  (BIT 17)
	 POPJ	P,0			;YES;LIST IT
	JRST	BC111E			;NO-CHECK PARITY
BC111D:	CAIN	T1,..RH11		;RH11?   [600]
	 JRST [	MOVE	T2,WKBUFF+MB%S2I	;RH11 CONTROL & STATUS 2
		TRNE	T2,1B24		;NXM?
		 POPJ	P,0		;YES! - LIST IT
		JRST	.+1 ]		;NO! - CONTINUE
	MOVE	T2,WKBUFF+MB%CS1	;GET CHAN STATUS 1	[547]
	TLNE	T2,1B22			;NXM?			[547]
	 POPJ	P,0			;YES! - LIST IT
BC111E:	TLNN	P4,E.LPAR		;CARE ABOUT PARITY ERRORS?
	 JRST ABORT			;NO THAT'S ALL I COVER
	MOVE	T1,MDEDTP		;GET DEVICE TYPE
	HLRZ	T1,PAR111(T1)		;GET DISPATCH ADDRESS
	PJRST	@T1			;DISPATCH TO ROUTINE  [607]

BC111F:	HRRZ	T2,WKBUFF+MB%REG+2	;ERROR REG
	TRNE	T2,1B32			;PARITY SET?
	 POPJ	P,0			;LIST	IT
	JRST	BC111J			;NO-CHECK CONTROLLER

BC111G:	HRRZ	T2,WKBUFF+MB%REG+2	;ERROR REG
	TRNE	T2,1B29!1B30!1B32	;THESE ARE POSSIBLE
	 POPJ	P,0
	JRST	BC111J			;NO

BC111H:	HRRZ	T2,WKBUFF+MB%REG+2	;ERROR REG
	TRNE	T2,1B20!1B27!1B29!1B32	;CHOICES  [601]
	 POPJ	P,0			;SET-LIST IT
			;OR FALL INTO

	;HERE TO CHECK PARITY ERRORS DET BY THE CONTROLLER
BC111J:	HRRZ	T2,WKBUFF+MB%REG	;CONTROL & STATUS 1  [600]
	TRNE	T2,1B22			;MCPE?
	 POPJ	P,0			;YEP! - GO LIST
	MOVE	T1,MASKON		;KONTROLLER TYPE
	CAIE	T1,..RH10		;RH10?
	 JRST	BC111K			;NO
	MOVE	T2,WKBUFF+MB%CNI
	TDNE	T2,[1B15!1B16!1B18]	;CHOICES
	 POPJ	P,0			;LIST IT
	JRST	ABORT			;FORGET IT

BC111K:	TRNE	T1,..RH20		;RH20?  [600]
	 JRST	BC111L			;NO!
	MOVE	T2,WKBUFF+MB%CNI
	TDNE	T2,[1B18!1B22]		;OTHER CHOICES
	 POPJ	P,0			;LIST
	JRST	ABORT			;FORGET IT

BC111L:	TRNE	T1,..RH11		;RH11? - HOPE SO!  [600]
	 JRST	ABORT			;NO!! - HELP!!!
	MOVE	T2,WKBUFF+MB%S2I	;CONTROL & STATUS 2
	TRNE	T2,1B22			;UPE?
	 POPJ	P,0			;YES! - LIST
	MOVE	T2,WKBUFF+MB%UBI	;UBA STATUS
	TRNE	T2,1B20			;BUS PARITY ERR?
	 POPJ	P,0			;YUP! - LIST
	JRST	ABORT			;NO! - FORGET IT
;PAR111 - DISPATCH TABLE FOR PARITY BIT-CHECK ROUTINES AND FOR
;	   ERROR BIT SUMMARY ROUTINES FOR DEVICES IN A 111 ENTRY
;	   PARITY CHECK,,BIT SUMMARY  (EDITS  [607] & [1217]

;THIS TABLE MUST BE KEPT IN LINE WITH THE UNIT TYPE TABLE IN THE UNIVERSAL
; FILE.  IN PARTICULAR THERE MUST BE AT LEAST ".UTMAX" ITEMS IN THE TABLE.

PAR111:	XWD	ABORT,SUMDUM	;UNKNOWN
	XWD	BC111H,S111H	;RP04
	XWD	BC111F,S111I	;RS04
	XWD	BC111G,S111J	;TU45
	XWD	BC111G,S111J	;TU16
	XWD	BC111H,S111H	;RP05
	XWD	BC111H,S111H	;RP06
	XWD	ABORT,SUMDUM	;RP07
	XWD	ABORT,SUMDUM	;RP08
	XWD	BC111H,S111K	;RM03
	XWD	ABORT,SUMDUM	;TM03
	XWD	BC111G,S111J	;TU77
	XWD	ABORT,SUMDUM	;TM78
	XWD	ABORT,SUMDUM	;TU78
	XWD	ABORT,SUMDUM	;DX20
	XWD	BC111G,S111L	;TU70
	XWD	BC111G,S111L	;TU71
	XWD	BC111G,S111L	;TU72
	XWD	BC111G,S111L	;TU73
BCK112:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM112	;GO DO IT
	TLNN	F,F.TRY		;RETRY?			[510]
	 JRST	BC112A		;NO! - SKIP		[510]
	HRRZ	T1,WKBUFF+DX%FEC;[707]GET # OF RETRIES	[510]
	CAMG	T1,RETRY	;ENTRY VALUE GREATER?	[510]
	 JRST	ABORT		;NO! - DON'T LIST	[510]
BC112A:	TLNN	F,F.DEV			;SAID /DEV:?
	 JRST	BK112B			;NO! - SKIP THIS SECTION
	MOVE	T1,DEV			;YES! - GET SPECIFIED NAME
	MOVE	T2,MDEDTP		;GET THIS ENTRIES DEVICE TYPE
	CAMN	T1,MDE000(T2)		;ARE THEY THE SAME?  [606]
	 JRST	.+3			;YES! - FORCE LISTING
	MOVEI	P3,MB%NAM		;NO! - TRY GENERAL TYPE
	PUSHJ	P,DEVCHK
	POP	P,P4			;GET CHARACTERISTICS BACK
	TLNE	F,F.OSUM	;ANY TYPE SWITCH CALLED LIKE /MASALL?
	 TLO	P4,E.LALL	;NO-FORCE LISTING
	PUSH	P,P4		;SAVE CHARACTERISTICS
BK112B:	TRNN	F,F.NDEV	;/NDEV:?
	 JRST	BC112B		;NOPE
	MOVEI	P3,MB%NAM
	PUSHJ	P,NDVCHK	;GO CHECK
BC112B:	TLNN	F,F.ID			;SAID /ID:?
	 JRST	BC112C
	MOVEI	P3,MB%VID
	PUSHJ	P,IDCHK
BC112C:	POP	P,P2		;GET ENTCHR BACK
	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPER	;LIST PERFORMANCE
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
BCK115:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM115	;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC115A		;NO GO AROUND
	MOVE	T1,DEV		;GET NAME SPECIFIED
	LDB	T2,[CS.UTP+WKBUFF] ;GET DEVICE TYPE
	CAMN	T1,MDE000(T2)	;IF THEY MATCH
	POPJ	P,0		; FORCE LISTING
	CAMN	T1,CS%DNM+WKBUFF ;TRY LOGICAL NAME
	POPJ	P,0
BC115A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
;SUPPORT FOR ER.SLM AND BIT CHECKING, CHECKS FOR /DEV AND/OR /ID
BCK116:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;PICKUP CHAR WORD
	PUSH	P,P2		;SAVE ENTCHR
	TLNE	P2,E.LSUM	;SUMMARY DESIRED
	PUSHJ	P,SUM116
	TLNN	F,F.DEV		;USER SAY /DEV?
	JRST	BC16.1		;NO GO AROUND
	MOVEI	P3,SLMDEV	;SET UP
	PUSHJ	P,DEVCHK		;AND CHECK IT
	POP	P,P2		;RETURN ENTCHR
	TLNE	F,F.OSUM	;/DEV ALONE?
	 TLO	P2,E.LALL	;YES, FORCE /ALL
	PUSH	P,P2		;SAVE IT AGAIN
BC16.1:	TLNN	F,F.ID		;/ID? = "WHO"
	 JRST	BC16.2		;NO
	MOVEI	P3,SLMWHO	;SETUP 
	PUSHJ	P,IDCHK		;MAKE CHECK
BC16.2:	POP	P,P2		;RESTORE ENTCHR
	TLNN	P2,E.LALL!E.LPER	;WANT ALL OR PER?
	JRST	ABORT		;LOSE
	POPJ	P,0		;WIN
;MORE FIXES FOR KLERR WITH EDIT  [1235]

BCK130:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	TLNE	P2,E.LSUM	;WANTS SUMMARY?
	 PUSHJ	P,SUM130	;DO IT
	HRRZ	T1,WKBUFF+FE%COD ;GET DEVICE CODE
	CAIE	T1,.KLERR	;IF NOT KLERR
	JRST	BC130X		; SKIP KLERR CHECK
	HRRZ	T2,WKBUFF+FE%OFF ;GET STD. STATUS WORD
	ADDI	T2,WKBUFF
	LDB	T2,[STD.ST(T2)]	
	TRNE	T2,1B30		;IF EOF IS SET
	JRST	BC130X		; PROCEED NORMALLY
	TRNN	F,F.REM		;IF NOT REMOTE
	JRST	ABORT		; ABORT

;[1266] REMOVED TO KEEP 130-201 ENTRIES FROM /REMOTE FILE UNLESS ASKED FOR.
;	POPJ	P,0		; ELSE FORCE TRANSFER

BC130X:	TLNN	F,F.DEV		;SAID /DEV:?
	 JRST	BC130A		;NOPE  [1200]
	HRRZ	T1,WKBUFF+FE%COD ;GET DEVICE CODE
	CAIL	T1,200		;IF NOT HARDWARE DEVICE
	JRST	BC130C		; TRY PSEUDO DEVICE
	MOVE	T1,FE$NAM(T1)	;NOW IN SIXBIT
	CAME	T1,DEV
	 JRST	ABORT		;NO MATCH
	TLNE	F,F.OSUM	;ANY TYPE SWITCH CALLED?
	 TLO	P2,E.LALL	;NO-FORCE LISTING
BC130A:	TLNE	P2,E.LALL	;LIST ALL?
	POPJ	P,0		;YES! - LIST IT!
	TLNE	P2,E.LPER	;LIST PERFORMANCE
	POPJ	P,0		;YES! - LIST IT!
	HRRZ	T2,WKBUFF+FE%COD
	CAIE	T2,200		;RELOAD?
	JRST	ABORT		;NOPE
	MOVE	T1,SWITCH	;GET ADDR OF COMMAND USED
	CAIE	T1,CPUPER	;"/CPUPER"?
	JRST	ABORT		;NOPE
	POPJ	P,0		;YES! - LIST IT!

BC130C:	SUBI	T1,200	;REMOVE OFFSET
	MOVE	T1,FEHNAM(T1)	;A HIGHER NAME
	CAME	T1,DEV		;MATCH?
	 JRST	BC130D		;CHECK FURTHER
	TLNE	F,F.OSUM	;ANY LISTING CALLED FOR?
	 TLO	P2,E.LALL	;NO-FORCE LISTING
	JRST	BC130A		;AND CONTINUE
BC130D:	HRRZ	T2,WKBUFF+FE%COD
	CAIE	T2,201		;KLERR?
	JRST	ABORT		;NOPE
	MOVE	T1,FEHNAM	;GET SIXBIT "KLCPU"
	CAME	T1,DEV	;MATCH
	 JRST	ABORT
	TLNE	F,F.OSUM
	 TLO	P2,E.LALL	;FORCE AS ABOVE
	JRST	BC130A		;AND CONTINUE
BCK131:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM131		;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC131A		;NO GO AROUND
	MOVE	T1,[SIXBIT/11CPU/]
	CAME	T1,DEV		;MATCH?
	 JRST	ABORT		;NOPE!
	TLNE	F,F.OSUM	;ANY TYPE SWITCH SPECIFIED?
	 TLO	P2,E.LALL	;NO FORCE LISTING
BC131A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPER	;LIST PERFORMANCE
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
BCK160:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM160		;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC160A		;NO GO AROUND
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV		;MATCH?
	 JRST	ABORT		;NOPE!
	TLNE	F,F.OSUM	;ANY TYPE SWITCH SPECIFIED?
	 TLO	P2,E.LALL	;NO FORCE LISTING
BC160A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPER	;LIST PERFORMANCE
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
BCK161:				; [614]
BCK162:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM161	;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC161A		;NO GO AROUND
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV		;MATCH?
	 JRST	ABORT		;NOPE!
	TLNE	F,F.OSUM	;ANY TYPE SWITCH SPECIFIED?
	 TLO	P2,E.LALL	;NO FORCE LISTING
BC161A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPER	;LIST PERFORMANCE
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
BCK133:
BCK163:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM163	;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC163A		;NO GO AROUND
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV		;MATCH?
	 JRST	ABORT		;NOPE!
	TLNE	F,F.OSUM	;ANY TYPE SWITCH SPECIFIED?
	 TLO	P2,E.LALL	;NO FORCE LISTING
BC163A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPAR	;LIST PARITY
	 POPJ	P,0		;YES
	TLNE	P2,E.LNXM	;LIST NXM
	POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK


BCK164:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)	;CHARACTERISTICS OF ENTRY
	PUSH	P,P2		;SAVE P2
	TLNE	P2,E.LSUM	;WANT SUMMARY?
	 PUSHJ	P,SUM164	;GO DO IT
	POP	P,P2		;RESTORE P2
	TLNN	F,F.DEV		;EDIT 211-SAID /DEV:?
	 JRST	BC164A		;NO GO AROUND
	MOVE	T1,[SIXBIT/MF20/]
	CAME	T1,DEV		;MATCH?
	 JRST	ABORT		;NOPE!
	TLNE	F,F.OSUM	;ANY TYPE SWITCH SPECIFIED?
	 TLO	P2,E.LALL	;NO FORCE LISTING
BC164A:	TLNE	P2,E.LALL	;LIST ALL?
	 POPJ	P,0		;YES
	TLNE	P2,E.LPAR	;LIST PARITY
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL TO CHECK
	SUBTTL	SUMMARY ROUTINES

SUM101:
SUM115:
SUM131:
SUM133:
SUM160:
SUM161:
SUM162:
SUM163:				; [740]
SUM164:
SUMDUM:	POPJ	P,0		;DUMMY SUMMARY ROUTINE
;START OF EDIT 1200

SUM102:	MOVE	T1,[NEGINF]		;[1260] MAKE SURE IT FIRST IN LIST
	MOVEM	T1,KEYBUF		;[1260] COUNT BUG TYPE
	MOVE	T1,WKBUFF+BG%FLG
	SKIPL	T1		;IF BUG TYPE OUT OF RANGE
	CAILE	T1,BG%MAX	;[1260]
	SETZ	T1,		; MAKE IT 'BUG???'
	MOVEM	T1,KEYBUF+1
	MOVE	T1,[1,,BUGLST]
	MOVE	T2,[2,,KEYBUF]
	GETBF
	 FATAL	<ERROR AT SUM102 - GETBF 1>
	AOS	(T1)
	MOVE	T1,KEYBUF+1	 ;COUNT BUG REASON
	MOVEM	T1,KEYBUF
	MOVE	T1,WKBUFF+BG%NAM
	MOVEM	T1,KEYBUF+1
	MOVE	T1,[1,,BUGLST]
	MOVE	T2,[2,,KEYBUF]
	GETBF
	 FATAL	<ERROR AT SUM102 - GETBF 2>
	AOS	(T1)
	POPJ	P,0		;DONE - RETURN
;REWRITTEN TO ALLOW FOR MORE THAN ONE WORD TO BE SUMMED FOR RH11  [600]
;REDONE FOR DYNAMIC TABLE ALLOCATION WITH EDITS  [1200] & [1217]

;DO CHANNEL TOTAL
SUM111:
SUM112:	LDB	T1,[MB.CHN+WKBUFF]	;GET CONTROLLER TYPE
	MOVEM	T1,KEYBUF
	MOVE	T1,WKBUFF+MB%CAD	;GET CHANNEL #
	MOVEM	T1,KEYBUF+1
	MOVE	T1,[1,,CHNTOT]
	MOVE	T2,[2,,KEYBUF]
	GETBF
	 FATAL	<ERROR AT SUM111 - GETBF CHNTOT>
	MOVEI	P3,1			;SET UP FOR SOFT ERROR
	MOVE	T2,WKBUFF+MB%IRS	;GET IORB STATUS WORD
	TLNE	T2,HRDERR		;IF IT'S HARD
	MOVSS	P3			; ADD TO LEFT HALF
	ADDM	P3,(T1)
;NOW CHANNEL ERROR BIT SUMMARY
; (HAVE CONTROLLER TYPE IN KEYBUF FROM ABOVE)
	MOVE	T1,WKBUFF+MB%NAM	;GET PHYSICAL DEVICE NAME IN SIXBIT
	MOVEM	T1,KEYBUF+1
	MOVE	T1,[17,,CHNLST]
	MOVE	T2,[2,,KEYBUF]
	GETBF
	 FATAL	<ERROR AT SUM111 - GETBF CHNLST>
	MOVE	P1,MASKON		;TYPE CONTROLLER SAVED BY MDECHR
	MOVE	P2,T1			;SAVE ERROR COUNTER BASE ADDRESS
	MOVE	T1,WKBUFF+MB%CNI	;CONI WORD (C & S #1 FOR RH11)
	PUSHJ	P,DYNSUM		;GO DO THE BIT COUNTING

	CAIE	P1,..RH11		;RH11? (USES 3 WORDS)
	JRST	S111B			;NO! - NO MORE

	MOVEI	P1,53			;OFFSET FOR C&S2
	ADDI	P2,NUMR11		;ADVANCE POINTER FOR 2ND WORD
	MOVE	T1,WKBUFF+MB%S2I	;RH11 C & S #2
	PUSHJ	P,DYNSUM		;GO DO THE BIT COUNTING

	MOVEI	P1,14			;OFFSET FOR UBA STATUS REGISTER
	ADDI	P2,NUMCS2		;ADVANCE POINTER FOR 3RD WORD
	MOVE	T1,WKBUFF+MB%UBI	;UBA STATUS REG.
	PUSHJ	P,DYNSUM		;GO DO THE BIT COUNTING
;NOW FOR DEVICE TOTAL
S111B:	LDB	T1,[MB.DEV+WKBUFF]	;GET DEVICE TYPE
	CAIL	T1,.UTMIN		;IF NOT A LEGAL DEVICE
	CAILE	T1,.UTMAX
	SETZ	T1,			; MAKE IT UNKNOWN
	MOVEM	T1,KEYBUF
	MOVE	T1,KEYBUF+1		;PUT DRIVE NAME FROM CHNLST IN KEY 2
	MOVEM	T1,KEYBUF+2
	MOVE	T1,ERTYPE		;IF NOT DX20 ERROR  [START 1206]
	CAIE	T1,SEC%DX		; (ERROR TYPE 112)
	JRST	S111A			; GET S/N FROM MB REG 10
	HRRZ	T4,WKBUFF+DX%DVL	;DEVICE VALUE SUB-BLOCK POINTER
	ADDI	T4,WKBUFF		;CREATE BUFFER POINTER
	LDB	T1,[POINT 8,DT%SBE(T4),9]	;LOW PART
	LDB	T2,[POINT 8,DT%SBD(T4),35]	;HIGH PART
	DPB	T2,[POINT 8,T1,27]	;COMBINE HIGH & LOW PARTS
	SKIPA				;SKIP OVER NON-DX20 STYLE  [END 1206]
S111A:	HRRZ	T1,WKBUFF+MB%REG+10	;S/N IN BCD FOR NORMAL MASBUSS DEVICES
	MOVEM	T1,KEYBUF+1
	MOVE	T1,[50,,MASLST]
	MOVE	T2,[3,,KEYBUF]
	GETBF
	 FATAL	<ERROR AT SUM111 - GETBF MASLST>
	ADDM	P3,(T1)			;HARD/SOFT FLAG SHOULD STILL BE SET UP
	AOS	P2,T1			;SETUP BASE POINTER FOR DEVICE REGISTERS

;START SUMMING DEVICE ERROR REGISTERS
	MOVE	T1,MDEDTP		;GET DEVICE TYPE
	HRRZ	T1,PAR111(T1)		;GET DISPATCH ADDRESS
	PJRST	@T1			;DISPATCH TO ROUTINE  [607]

	;HERE FOR RP04, RP05, RP06
S111H:	MOVEI	P1,21			;OFFSET FOR RP04 ERROR REG #1
	HRLZ	T1,WKBUFF+MB%REG+2	;WORD TO SUMMATE
	PUSHJ	P,DYNSUM		;GO DO THE BIT COUNTING

	MOVEI	P1,22			;OFFSET FOR RP04 ERROR REG #2
	ADDI	P2,NURP02		;ADVANCE POINTER FOR 2ND WORD
	HRLZ	T1,WKBUFF+MB%REG+14	;2ND WORD - RP04 ERROR REG #2
	PUSHJ	P,DYNSUM		;GO DO THE BIT COUNTING

	MOVEI	P1,23			;OFFSET FOR RP04 ERROR REG #3
	ADDI	P2,NURP10		;ADVANCE POINTER FOR 3RD WORD
	HRLZ	T1,WKBUFF+MB%REG+15	;3RD WORD - RP04 ERROR REG #3
	PJRST	DYNSUM			;GO DO THE BIT COUNTING

	;HERE FOR RS04
S111I:	MOVEI	P1,25			;OFFSET FOR RS04 ERROR REGISTER
	HRLZ	T1,WKBUFF+MB%REG+2	;WORD TO SUMMATE
	PJRST	DYNSUM			;GO DO THE BIT COUNTING

	;HERE FOR TU16, TU45, TU77
S111J:	MOVEI	P1,27			;OFFSET FOR TU16 ERROR REGISTER
	HRLZ	T1,WKBUFF+MB%REG+2	;WORD TO SUMMATE
	PJRST	DYNSUM			;GO DO THE BIT COUNTING

	;HERE FOR RM03  [601]
S111K:	MOVEI	P1,21			;OFFSET FOR RM03 ERROR REG #1
	HRLZ	T1,WKBUFF+MB%REG+2	;WORD TO SUMMATE
	PUSHJ	P,DYNSUM		;GO DO THE BIT COUNTING

	MOVEI	P1,56			;OFFSET FOR RP04 ERROR REG #2
	ADDI	P2,NURP02		;ADVANCE POINTER FOR 2ND WORD
	HRLZ	T1,WKBUFF+MB%REG+15	;WORD TO SUMMATE
	PJRST	DYNSUM			;GO DO THE BIT COUNTING

	;HERE FOR TU70, TU71, TU72, TU73
S111L:	MOVEI	P1,51			;OFFSET FOR TU70 ERROR REG #1
	HRRZ	T1,WKBUFF+DX%MBR	;MASBUSS REG SUB-BLOCK POINTER
	HRLZ	T1,WKBUFF+2(T1)		;WORD TO SUMMATE
	PJRST	DYNSUM			;GO DO THE BIT COUNTING

;END OFF EDIT  [1217]
SUM116:	MOVE	T2,WKBUFF+SLMWHO	;SAME AS SUM1 BASICALLY
	MOVEI	T1,WHOSLM		;INIT POINTER
WHOFND:	HLRZ	T3,(T1)			;GET POINTER TO NEXT
	JUMPE	T3,WHONEW		;EXIT IF NO REASON
	MOVEI	T1,(T3)			;SETUP POINTER
	CAME	T2,1(T1)		;IS THIS THE ENTRY?
	 JRST	WHOFND			;NO,GET NEXT
	AOS	T3,(T1)			;BUMP
	TRNN	T3,-1			;BUT
	  SOS	(T1)			;NOT TOO MUCH(OVERFLOW)
	PJRST	SM116A
	
WHONEW:	AOS	T3,.JBFF		;NEXT POSITION
	AOS	.JBFF			;CLEAN HOUSE
	CAMG	T3,.JBREL		;IS THERE ROOM?
	 JRST	WHOINS			;YES INSERT REASON
	MOVE	T4,T3			;DIFFERENT AC
	CORE	T4,			;GET MORE CORE
	 FATAL	<SYRNCA: NO CORE AVAILABLE>	;OPPS

WHOINS:	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
	PJRST	SM116A		;DO SECON HALF


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

DEVINS:	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
;START EDIT 1200

SUM130:	LDB	T1,[FE.DEV+WKBUFF] ;GET DEVICE CODE
	CAIL	T1,200		;IF IN PSEUDO RANGE
	JRST	SM130B		; CHECK LEGALITY
	CAILE	T1,.FEMAX	;IF OUT OF CURRENT REAL RANGE
SM130A:	SETZ	T1,		; MAKE IT UNKNOWN
	MOVE	T1,FE$NAM(T1)	;GET SIXBIT DEVICE NAME
	JRST	SM130G		; AND COUNT IT
	
SM130B:	CAILE	T1,.KLMAX	;IF OUT OF CURRENT PSEUDO RANGE
	JRST	SM130A		; MAKE IT UNKNOWN
	CAIE	T1,.KLERR	;IF NOT KLERR
	JRST	SM130C		; JUST COUNT ENTRY
	HRRZ	T2,WKBUFF+FE%OFF ;GET STD. STATUS WORD
	ADDI	T2,WKBUFF
	LDB	T2,[STD.ST(T2)]	
	TRNE	T2,1B30		;IF EOF IS SET
	JRST	SM130K		; COUNT REPORT

SM130C:	SUBI	T1,200		;REMOVE OFFSET
	MOVE	T1,FEHNAM(T1)	;GET SIXBIT DEVICE NAME
SM130G:	MOVEM	T1,KEYBUF	;COUNT ENTRY
	MOVE	T1,[1,,FE.LST]
	MOVE	T2,[1,,KEYBUF]
	GETBF
	 FATAL	<ERROR AT SM130G - GETBF>
	AOS	(T1)
	POPJ	P,0		;RETURN

SM130K:	SUBI	T1,200		;REMOVE OFFSET
	MOVE	T1,FEHNAM(T1)	;GET SIXBIT DEVICE NAME
	MOVEM	T1,KEYBUF	;COUNT ENTRY & REPORT
	MOVE	T1,[1,,FE.LST]
	MOVE	T2,[1,,KEYBUF]
	GETBF
	 FATAL	<ERROR AT SM130K - GETBF>
	MOVE	T2,[1,,1]
	ADDM	T2,(T1)
	POPJ	P,0		;RETURN

;END EDIT 1200
COMMENT \ I DON'T THINK WE NEED THIS CODE  [PJB]

	;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

	POPJ	P,		;RETURN
\
	SUBTTL	STORAGE LOCATIONS
DUMDAY:	121165		;DUMMY NBS DAY FOR USE BY SCAN
KONMSK:	0			;MASK FOR ERROR BITS IN RC10 TYPE DEVICE
	0			;MASK FOR ERROR BITS IN RP10 TYPE DEVICE
	SFMASK			;SOFTWARE DETECTED ERROR MASK
	TMMASK
	RHMASK
	RH20SK
	DXMASK
	TCMASK
	DL1MSK
	DL2MSK
	KLAMSK			;KL10 CONI APR
	RH11SK			;RH11 CONTROL & STATUS 1  [600]
	UBAMSK			;UBA STATUS  [600]
	KSAMSK			;KS10 CONI APR
	0
	0
	P4SRSK
	P4ERSK
	P4CBSK
	P4DASK
	S4SRSK
	S4ERSK
	T6SRSK
	T6ERSK
	ICPCSK
	DXTBSK
	SB03SK
	SB47SK
	RP05SK
	RP06SK
	FESTSK
	FELPSK
	LPSASK
	LPSBSK
	FECDSK
	CDSTSK
	RHSWSK
	RLD1SK
	FEKLSK
	RPMRSK
	DXSRSK
	DXERSK
	DXMRSK
	CS2MSK			;RH11 CONTROL & STATUS #2  [600]
	RMM1SK			;RM03 MAINT REG 1  [601]
	RMM2SK			;RM03 MAINT REG 2  [601]
	RME2SK			;RM03 ERROR REG 2  (15)  [601]
	SCRMSK			;DH11 SYSTEM CONTROL REGISTER  [1223]
	NRCMSK			;DH11 NEXT RECEIVED CHARACTER REGISTER  [1223]
MINERB:	0
	0
	MINSFB
	MINTMB
	MINRHB
	MINRH2
	MINDXB
	MINTCB
	MINDL1
	MINDL2
	MINKLA
	MINR11
	MINUBA
	MINKSA
	0
	0
	MIRP01
	MIRP02
	MIRP10
	MIRP15
	MIRS01
	MIRS02
	MIT601
	MIT602
	MIICPC
	MIDXTB
	MISB03
	MISB47
	MIRP05
	MIRP06
	MIFEST
	MIFELP
	MILPSA
	MILPSB
	MIFECD
	MICDST
	MIRHSW
	MIRLD1
	MIFEKL
	MIRPMR
	MIDXSR
	MIDXER
	MIDXMR
	MINCS2
	MINMR1
	MINMR2
	MINER2
	MINSCR			;DH11 SYSTEM CONTROL REGISTER  [1223]
	MINNRC			;DH11 NEXT RECEIVED CHARACTER REGISTER  [1223]
ERINDX:	0
	0
	0	;SFINDX
	0	;TMINDX
	RHINDX
	RH20DX
	0	;DXINDX
	0	;TCINDX
	0	;DL1IND
	0	;DL2IND
	KLAIND
	RH11DX
	UBADX
	KSAIND
	0	;0
	0	;0
	RP01DX
	RP02DX
	RP10DX
	RP15DX
	RS01DX
	RS02DX
	T601DX
	T602DX
	0	;ICPCDX
	0	;DXTBDX
	SB03DX
	SB47DX
	RP05DX
	RP06DX
	FESTDX
	FELPDX
	LPSADX
	LPSBDX
	FECDDX
	CDSTDX
	RHSWDX
	RLD1DX
	FEKLDX
	RPMRDX
	DXSRDX
	DXERDX
	DXMRDX
	CS2DX
	RMR1DX
	RMR2DX
	RME2DX
	SCRIND			;DH11 SYSTEM CONTROL REGISTER  [1223]
	NRCIND			;DH11 NEXT RECEIVED CHARACTER REGISTER  [1223]
COMMENT \ I THINK THIS CAN BE REMOVED  [PJB]

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 VARIOUS NECESSARY DISPATCH TABLES
	;DUMENT -- DUMMY MACRO LEVEL 2
	;SUBMACRO TBLENT
	;ARGS
	;A - ERROR CODE				(xxx)
	;B - ERROR DESCRIPTION			(text)
	;C - DETAIL CONTROL TABLE ADDRESS	(.CTxxx)
	;D - ENTRY LEVEL PROCESSOR ADDRESS	(PROCSx)
	;E - # OF LINES OF OUTPUT GENERATED BY THIS ENTRY EXCLUDING HEADER
	;F - BRIEF CONTROL TABLE ADDRESS	(.BRxxx)


;THIS TABLE CONTAINS ALL THE ERROR TYPES KNOWN TO ALL SYSERR PARTS.
; IT IS USED TO FIND THE OFFSET INTO THE "PCSTBL" TABLE (OFFSET SAVED IN ALLIND)

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

ALLTBL:	DUMENT

ALLLTH==.-ALLTBL		;LENGTH OF ERROR INDEX TABLE


;THIS TABLE CONTAINS THE ERROR TYPES PROCESSED BY THIS SEGMENT IN THE RIGHT HALF
; AND THE POINTER TO THE BRIEF PROCESS TABLE FOR EACH ENTRY IN THE LEFT HALF
; IT IS USED TO FIND THE OFFSET INTO THE "TYPMES", "BITCHK, AND "LINE" TABLES
; INDEX IS SAVED IN ERRIND

DEFINE	TBLENT(A,B,C,D,E,F)<
	IFIDN<D><PROCSD><
		XWD  F,A
	>
>

ERRTBL:	0			;FIRST FOUND MUST NOT BE 0
	DUMENT

ERRLTH==.-ERRTBL		;LENGTH OF ERROR INDEX TABLE


;THIS TABLE CONTAINS THE ADDRESS OF EACH ENTRY'S PROCESSOR IN THE RIGHT HALF
; AND THE ADDRESS OF THE DETAIL CONTROL TABLE FOR THE ENTRIES PROCESSED
; BY THIS SEGMENT IN THE LEFT HALF  (TABLE IS INDEXED BY ALLIND)

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


;THIS TABLE CONTAINS THE POINTERS TO THE ERROR DESCRIPTION TEXT FOR
; EACH ENTRY PROCESSED BY THIS SEGMENT  (TABLE IS INDEXED BY ERRIND)
DEFINE	TBLENT(A,B,C,D,E)<
	IFIDN<D><PROCSD><
		[ASCIZ/B/]
	>
>

TYPMES:	0
	DUMENT


;THIS TABLE CONTAINS THE ADDRESSES OF THE BIT CHECK ROUTINES FOR EACH OF THE
; ENTRIES PROCESSED BY THIS SEGMENT  (TABLE IS INDEXED BY ERRIND)

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

BITCHK:	0
	DUMENT


;THIS TABLE CONTAINS THE ENRTY LENGTHS FOR EACH OF THE ENTRIES PROCESSED
; BY THIS SEGMENT  (TABLE IS INDEXED BY ERRIND)

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

	RADIX	10

LINE:	0
	DUMENT

	RADIX	8
	SUBTTL	CONTROL TABLES

;GENERATE THE VARIOUS ENTRY CONTROL TABLES USING THE MACRO TBLWRD FOR DETAIL
; AND THE MACRO CMDWRD FOR BRIEF

DEFINE	TBLWRD(A,B,C,D,E,F)<
	IFDIF<D><SPECL>,<BYTE (6)B,C,D(18)T'A'E>
	IFIDN<D><SPECL>,<BYTE (6)B,C,D(18)F>
>

.BR101:	BRF101
.CT101:	DUM101
	Z
.BR102:	BRF102
.CT102:	DUM102
	Z
.BR111:	BRF111
.CT111:	DUM111
	Z
.BR112:	BRF112
.CT112:	DUM112
	Z
.BR115:	BRF115
.CT115:	DUM115
	Z
.BR116:	BRF116
.CT116:	DUM116
	Z
.BR130:	BRF130
.CT130:	DUM130
	Z
.BR131:	BRF131
.CT131:	DUM131
	Z
.BR133:	BRF133
.CT133:	DUM133
	Z
.BR160:	BRF160
.CT160:	DUM160
	Z
.BR161:	BRF161
.CT161:	DUM161
	Z
.BR162:	BRF162
.CT162:	DUM162
	Z
.BR163:	BRF163
.CT163:	DUM163
	Z
.BR164:	BRF164
.CT164:	DUM164
	Z
	SUBTTL	MORE MACRO EXPANSIONS

;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 FOLOWING CODE.
	XLIST
	DUMALL
	LIST

COMMENT \ I THINK THIS STUFF CAN BE REMOVED TOO  [PJB]

	;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 A MACRO TO SETUP DEFAULTS

	DEFVAL

	;NOW MAKE SWTCHS MACRO FOR USE WITH DOSCAN LATER

DEFINE	SWTCHS<
	DUMCH1
	DUMCH2
>

;DOSCAN(SWTAB) EXPANSION IS XLISTED
	XLIST
	DOSCAN(SWTAB)
	LIST
\
	;GENERATE THE CONI BIT TEXT AND ADDRESS DISPATCHER
	RADIX	10		;****** NOTE WELL *****
	SALL

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

SOFTDV:	DUMSF1
TM10DV:	DUMTM1
RH10DV:	DUMRH1
RH20DV:	DUMRH2
DX10DV:	DUMDX1
TC10DV:	DUMTC1
DL10DV:	DUMDL1
DL11DV:	DUMDL2
KL1ADV:	DUMKLA
RH11DV:	DUMR11
UBADV:	DUMUBA
KS1ADV:	DUMKSA
	;16
	;17
RP04SR:	DURP01
RP04ER:	DURP02
RP04CB:	DURP10
RP04DA:	DURP15
RS04SR:	DURS01
RS04ER:	DURS02
TU16SR:	DUT601
TU16ER:	DUT602
ICPCX1:	DUICPC
DXTAGB:	DUDXTB
DXSB03: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