Google
 

Trailing-Edge - PDP-10 Archives - BB-L288A-RM - swskit-changed-sources/syserc.mac
There are 15 other files named syserc.mac in the archive. Click here to see a list.
	TITLE	SYSERC -- SYSTEM ERROR FILE PROCESSOR -- MAINLINE CODE
SUBTTL	VERSION 15A(1363)	K. COYE/ RLD/ PJB/ ES/ TJW/ LWE/ SRL/ GSK





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


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


;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<
	DUM030
	DUM031
	DUM033
	DUM051
	DUM052
	DUM054
	DUM055
	DUM056
	DUM057
	DUM060
	DUM061
	DUM062
	DUM063
	DUM064
	DUM066
	DUM067
>

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

	EXTERNAL HEADRD,ABORT,CHRCHK,DATECK,FILERR,TOOBIG,MBCHAR
	EXTERNAL CNISUM,BADNAM,MASSVM,DEVCHK,ERRINT,SKIPIT,IDCHK
	EXTERNAL STRCHK,DETCHK,DMPENT,HDRLST,PAGXCD,DVCHAR,TMCHAR
	EXTERNAL SAYDAY,GETNBS,.OCTLE,.DECML,.ASCIE,.SIXBT,FIXOFF
	EXTERNAL .HAFWD,.SPECL,.HTIME,.PPNWW,.ODECW,.UDATE,.TASCI,.PPNWT
	EXTERNAL .TDIRW,R5VSIX,MONVER,BADADD,TAB031,TYPAST,BLDPTR
	EXTERNAL ACLST,SAVE4P,RET4P,HWDUMP,TYPBCD,LSTEB,JFLOOP,CNIDCD
	EXTERNAL XORTAB,BITLST,.DVTAB,.MXBLK,.TRBLK,.SUBLK,.SECBK
	EXTERNAL WDCNT,COMPAR,SKPRTN,TYPNBS,TITLST,SKIPWD,ADVBFF
	EXTERNAL FIXBUF,STBUFF,INPWD,GOSUM,GETWD,FFPRNT,SLPRNT,CLPRNT
	EXTERNAL TBPRNT,CHROUT,TTYSIX,MDECHR,FIXNAM,SBUSFN,FE.KLI
	EXTERNAL FE%DEV,KR%ECD,HKSTRG,DUMPOS,DSKPOS,TAPPOS,COLOUT,SBDOUT
	EXTERNAL LP$CFG,DH$CFG,CD$CFG,FE$DL1,FE$DLS,FE$DTE,FE$RJP,FE$DM1





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


	.JBVER==137
	LOC	.JBVER

	BYTE	(3)VWHO(9)VSYSER(6)VMINOR(18)VEDIT
	IFN	EXPPRT,<
	LALL
	>
	IFE	EXPPRT,<
	SALL
	>


	TWOSEG
	RELOC	400000
;DUMMY ROUTINES TO COMPILE ERROR-FREE
MASNA2:
MASLT2==0
MDE000:
BLTTAB:	BLOCK 0				;GIVE IT SOME SPACE

;PROCSC -- STANDARD ENTRY PROCESSOR #1
;CALL	JRST PROCSC
;
;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

PROCSC:	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		;[153]DONT TRY TO ACCESS WORDS OUTSIDE OF ENTRY
	AOJA	CTINDX,PROCSC		;GET NEXT WORD IN CTL TABLE
	CAILE	T2,WKSIZE		;MAKE SURE THE WORD ASKED FOR IS IN WORK BUFFER
	AOJA	CTINDX,PROCSC		;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,PROCSC		;EITHER NOT KNOWN OR FALL HERE

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



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

AOBQIT:	POP	P,T2			;DUMMY POP TO FIX PDP
	AOJA	CTINDX,PROCSC		;BUMP CTINDX AND BACK TO START
	SUBTTL	DIALOG RELATED SUBROUTINES
;HERE IS THE DUMMY PROCSB FOR THIS HIGH SEG
;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
;WITH 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
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 PROCSA

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

PROCSD:	MOVE	T1,[SIXBIT/SYSERD/]	;[1342]
	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





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

STARTC:	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?
	 TRNE	F,F.SEQ
	  JRST	START1
	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
	FATAL	<ENTRY WITH ZERO LENGTH BODY SPECIFIED>
	MOVE	P4,ERRIND
	TLNE	F,F.BTCK		;ANY TO DO?
	PUSHJ	P,@BITCHK(P4)		;GO DO IT
	TRNE	F,F.REM			;[417]/REMOTE?
	 PUSHJ	P,REMDAT##
	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	<HTIME>
	SINDEX	<PPNWW>

;SPECIAL LISTING ROUTINES START HERE.

;FIRST THE SPECIAL ROUTINES FOR ER.KDT & ER.KDI.
;P2 HAS KDTPFW

KDTLST:	PUSHJ	P,.TCRLF
	TYPEIT	<STATUS AT ERROR:
	BAD DATA DETECTED BY:	>
	MOVEI	T1,[ASCIZ/UNKNOWN/]
	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+KDTBDW	;GET IT
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	<
	GOOD DATA WORD:	>
	MOVE	P2,WKBUFF+KDTGDW	;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+KDTPMA
	AND	T1,[17,,777777]		;GET JUST ADDRESS
	PUSHJ	P,.TOCTW
	TYPEIT	<
	RECOVERY:	>
	MOVE	P1,WKBUFF+KDTTRY	;RETRY WORD
	MOVE	T1,[SIXBIT/CONT./]	;ASSUME GOODNESS
	TLNE	P1,ERRHRD		;BETTER CHECK
	 MOVE	T1,[SIXBIT/CRASH/]
	PUSHJ	P,.TSIXN

	TYPEIT	< USER
	RETRY COUNT:	
		W CACHE:	>
	LDB	T1,[POINT 9,P1,35]	;RH OF WORD
	PUSHJ	P,.ODECW
	TYPEIT	<
		W-O CACHE:	>
	LDB	T1,[POINT 9,P1,26]	;LH OF 18-35
	PUSHJ	P,.ODECW
	TLNE	P1,1B21			;CACHEIN USE?
	PUSHJ	P,[ TYPEIT (, CACHE WAS ENABLED)
			POPJ P,0]
	TLNE	P1,1B22
	PUSHJ	P,[ TYPEIT (ERROR DURING CACHE SWEEP TO CORE)
			POPJ P,0]
	TLNE	P1,1B20
	 PUSHJ	P,[ TYPEIT (CACHE FAILURE)
			POPJ	P,0]
;[700-RLD]
	TLNE	P1,1B23			;WAS CACHE DISABLED?
	 PUSHJ	P,[ TYPEIT	(, CACHE WAS DISABLED )
			POPJ	P,0]
;END [700-RLD]
	POPJ	P,0			;BACK TO PROCSC
;HERE ARE THE ROUTINES FOR ER.KAE
;CHANGED CONSIDERABLY BY EDIT 1137[TJW]

KAELST:	TYPEIT	<
	CONI APR:	>
	MOVE	P1,WKBUFF+KAECNI	;GET THE APR CONI
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI	T1,12			;OFFSET FOR CONI APR KL10
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD		;GO TRANSLATE
	TYPEIT	<
	ERA:		>
	MOVE	P1,WKBUFF+KAEERA
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	< = WD # >
	LDB	T1,[POINT 2,P1,1]	;GET WORD #
	PUSHJ	P,.TOCTW
	TLNE	P1,1B20			;SWEEP?
	 PUSHJ	P,[TYPEIT	(, SWEEP REF)
		POPJ	P,0]
	TLNE	P1,1B21			;CHAN?
	PUSHJ	P,[TYPEIT (, CHAN REF)
		POPJ	P,0]
	LDB	T2,[POINT 3,P1,6]	;GET DATA SOURCE & WRITE BIT
	MOVE	T1,ERAMES(T2)		;ADDR OF SOME ASCIZ
	PUSHJ	P,.TSTRG
	TYPEIT	<
	BASE PHY. MEM ADDR.
	 AT FAILURE:	>
	LDB	T1,[POINT 22,P1,35]	;22 BITS OF ADDR 
	PUSHJ	P,.TOCTW		;NOT HALF WORD
KAELS3:	SETZ	P1,
	PUSHJ	P,DETCHK##		;USER SAID /DETAIL?
	POPJ	P,0			;YES,CONTINUE WITH PROCSC.


KAE00A:	SKIPN	P2			;[1236] IS PTR = 0?
	PJRST	SBUSFN			;[1236]YES MAKE CALL WITH IT = 0
	MOVE	T1,P2			;[1137]GET SBDIAG TABLE PTR
	SUBI	T1,4			;ADJUST FOR HDR WDS
	MOVE	P2,T1
	PJRST	SBUSFN

KAELSA:	TYPEIT	<
MEMORY PLACED OFF-LINE:
>
	SETZM	KFLAG			;0=K
	SKIPE	WKBUFF+KAEKPG		;0=K
	 SETOM	KFLAG			;1=PGS
	MOVE	P1,WKBUFF+KAEBEF	;FIRST POINTER
	PUSHJ	P,BLDPTR		;CORRECTED
	MOVE	P2,P1			;SAVED
	MOVE	P1,WKBUFF+KAEAFT	;SECONT POINTER
	PUSHJ	P,BLDPTR		;CORRECTED
	PUSHJ	P,XORTAB		;FIND DIFFERENCES
	PUSHJ	P,BITLST		;LIST DIFFERENCES
	PUSHJ	P,TITLST		;START ON NEXT PAGE
	POPJ	P,0			;RETURN TO PROCSC


NXSLST:	TYPEIT	<
MEMORY PLACED OFF-LINE:
>
	SETZM	KFLAG			;0=K
	SKIPE	WKBUFF+NXSFLG		;0=K
	 SETOM	KFLAG			;1=PGS
	MOVE	P1,WKBUFF+NXSBEF	;FIRST POINTER
	PUSHJ	P,BLDPTR		;CORRECTED
	MOVE	P2,P1			;SAVED
	MOVE	P1,WKBUFF+NXSAFT	;SECONT POINTER
	PUSHJ	P,BLDPTR		;CORRECTED
	PUSHJ	P,XORTAB		;FIND DIFFERENCES
	PUSHJ	P,BITLST		;LIST DIFFERENCES
	PUSHJ	P,TITLST		;START ON NEXT PAGE
	POPJ	P,0			;RETURN TO PROCSC

;HERE ARE THE FEW SPECIAL ROUTINES REQUIRED FOR THE SIX
;NEW ENTRIES SUPPLIED WITH TOPS-10 7.01.

;FOR KI10 NXM OR PARITY INTERRUPT
KII001:	TYPEIT	<
	CONI APR AT INTERRUPT:	>
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI	T1,13			;MAGIC # FOR KI10 CONI APR
	MOVEM	T1,KONTYP
	MOVE	P1,WKBUFF+KIIAPR
	PUSHJ	P,CNIDCD
	POPJ	P,0

;FOR KL10 NXM OR PARITY INTERRUPT
KLI001:	TYPEIT	<
	CONI APR AT INTERRUPT:	>
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI	T1,12			;MAGIC # FOR KL10 CONI APR
	MOVEM	T1,KONTYP
	MOVE	P1,WKBUFF+KLIAPR
	PUSHJ	P,CNIDCD
	TYPEIT	<
	ERA:		>
	MOVE	P1,WKBUFF+KLIERA
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	< = WD # >
	LDB	T1,[POINT 2,P1,1]	;GET WORD #
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TSPAC
	TLNE	P1,1B20			;SWEEP?
	 PUSHJ	P,[TYPEIT	(, SWEEP REF)
		POPJ	P,0]
	TLNE	P1,1B21			;CHAN?
	PUSHJ	P,[TYPEIT (, CHAN REF)
		POPJ	P,0]
	LDB	T2,[POINT 3,P1,6]	;GET DATA SOURCE & WRITE BIT
	MOVE	T1,ERAMES(T2)		;ADDR OF SOME ASCIZ
	PUSHJ	P,.TSTRG

;NOW FOR MEM ADDR

	TYPEIT	<
	BASE PHY. MEM ADDR.
	 AT FAILURE:	>
	LDB	T1,[POINT 22,P1,35]	;22 BITS OF ADDR 
	PUSHJ	P,.TOCTW		;NOT HALF WORD
	POPJ	P,0



;KSN001 - DECODES PAGE FAIL WORD FOR KS10 - IN P2

KSN001:	TYPEIT	<
	PAGE FAIL WORD:	>
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	TYPEIT	<
	PAGE FAIL CODE:	>
	LDB	T1,[POINT 5,P2,5]
	MOVE	P2,T1
	PUSHJ	P,.TOCTW
	TYPEIT	< = >
	MOVEI	T1,[ASCIZ/UNKNOWN/]
	CAIN 	P2,20
	 MOVEI	T1,[ASCIZ/I-O NXM/]
	CAIN 	P2,36
	 MOVEI	T1,[ASCIZ/HARD MEMORY ERROR/]
	CAIN	P2,37
	 MOVEI	T1,[ASCIZ/NXM/]
	PUSHJ	P,.TSTRG
	POPJ	P,0

;KLT001 - DECODE PAGE FAIL WORD AND LIST GOOD DATA,BAD DATA
;AND XOR DIFF. FOR KL10 OR KS10(USES KSN001) PG FAIL WD IN P2

KLT001:	MOVE	T1,WKBUFF+KLTRET	;GET RETRY WORD
	TLNE	T1,1B18			;IS THIS A KS10?
	 JRST	[ PUSHJ	P,KSN001
		  JRST	KLT00A	]	;YES
	TYPEIT	<
	PAGE FAIL WORD:	>
	MOVE	T1,P2			;SHOULD STILL BE THERE
	PUSHJ	P,.TXWDW
	TYPEIT	<
	PAGE FAIL CODE:	>
	LDB	T1,[POINT 5,P2,5]
	PUSHJ	P,.TOCTW
	TYPEIT	< = >
	MOVEI	T1,[ASCIZ/UNKNOWN/]
	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
KLT00A:	TYPEIT	<
	BAD DATA WORD:	>
	MOVE	P1,WKBUFF+KLTBDW	;GET IT
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	<
	GOOD DATA WORD:	>
	MOVE	P2,WKBUFF+KLTGDW	;GOOD CONTENTS,MAYBE
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	XOR	P1,P2			;CREATE DIFFERENCE
	TYPEIT	<
	DIFFERENCE:	>
	MOVE	T1,P1
	PUSHJ	P,.TXWDW


	TYPEIT	<
	RECOVERY:	>
	MOVE	P1,WKBUFF+KLTRET	;RETRY WORD
	MOVE	T1,[SIXBIT/CONT./]	;ASSUME GOODNESS
	TLNE	P1,ERRHRD		;BETTER CHECK
	 MOVE	T1,[SIXBIT/CRASH/]
	PUSHJ	P,.TSIXN

	TYPEIT	< USER
	RETRY COUNT:	>
	TLNE	P1,1B18			;KS10?
	 JRST	[ LDB T1,[POINT 9,P1,35]
		  PUSHJ	P,.ODECW
		  PUSHJ	P,.TCRLF
		  POPJ	P,0		]	;YES, JUST LIST RETRY COUNT
					;THEN RETURN
	TYPEIT	<
		W CACHE:	>
	LDB	T1,[POINT 9,P1,35]	;RH OF WORD
	PUSHJ	P,.ODECW
	TYPEIT	<
		W-O CACHE:	>
	LDB	T1,[POINT 9,P1,26]	;LH OF 18-35
	PUSHJ	P,.ODECW
	TLNE	P1,1B21			;CACHE IN USE?
	PUSHJ	P,[ TYPEIT (, CACHE WAS ENABLED)
			POPJ P,0]
	TLNE	P1,1B22
	PUSHJ	P,[ TYPEIT (ERROR DURING CACHE SWEEP TO CORE)
			POPJ P,0]
	TLNE	P1,1B20
	 PUSHJ	P,[ TYPEIT (CACHE FAILURE)
			POPJ	P,0]
;[700-RLD]
	TLNE	P1,1B23			;WAS CACHE DISABLED?
	 PUSHJ	P,[ TYPEIT	(, CACHE WAS DISABLED )
			POPJ	P,0]
;END [700-RLD]
	POPJ	P,0			;BACK TO PROCSC
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/]

NODET:	TYPEIT	<
=====REST OF INFORMATION AVAILABLE BY USING /DETAIL: SWITCH=====>
	JRST	ABORT			;NO MORE PROCESSING OF THIS ENTRY.

MDTLST:					;FOR 614 EDIT
KDILST:	TYPEIT	<
STATUS AT INTERRUPT:
	CONI APR:	>
	MOVE	P1,WKBUFF+KDICNI
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI	T1,12			;OFFSET FOR
	MOVEM	T1,KONTYP		;KL10 APR
	PUSHJ	P,CNIDCD

;NOW FOR ERA

	TYPEIT	<
	ERA:		>
	MOVE	P1,WKBUFF+KDIERA
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	< = WD # >
	LDB	T1,[POINT 2,P1,1]	;GET WORD #
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TSPAC
	TLNE	P1,1B20			;SWEEP?
	 PUSHJ	P,[TYPEIT	(, SWEEP REF)
		POPJ	P,0]
	TLNE	P1,1B21			;CHAN?
	PUSHJ	P,[TYPEIT (, CHAN REF)
		POPJ	P,0]
	LDB	T2,[POINT 3,P1,6]	;GET DATA SOURCE & WRITE BIT
	MOVE	T1,ERAMES(T2)		;ADDR OF SOME ASCIZ
	PUSHJ	P,.TSTRG

;NOW FOR MEM ADDR

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

	PUSH	P,P1
	SETZ	P1,
	PUSHJ	P,DETCHK		;USER SAID /DETAIL?
	POP	P,P1
	POPJ	P,0			;YES,CONTINUE WITH PROCSC.

MDT00A:	MOVE	T1,P2
	SKIPN	P2			;[1236]IS PTR 0?
	 PJRST	SBUSFN			;[1236]MAKE CALL WITH PTR = 0
	SUBI	T1,4			;OTHERWISE FIX OFFSET
	MOVE	P2,T1
	PJRST	SBUSFN			;AND MAKE THE CALL

;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
KDILSA:	TYPEIT	<
SYSTEM MEMORY MAP
	INTERLEAVE MODE:	>
	MOVE	P1,P2
	HRRZ	T1,P1			;OFFSET ONLY
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF		;CORRECTED
	HRR	P1,T1			;POINTER
	SKIPN	P2,0(P1)		;DMA PRESENT?
	 JRST	KDILS1			;NO
	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:	>
	LDB	P3,[POINT 4,P2,5]	;3 ERROR BITS
	SKIPN	P3			;ANY SET?
	 PUSHJ	P,[TYPEIT (NONE)
		POPJ	P,0]
	TRNE	P3,1B32			;[435] NXM?
	 PUSHJ	P,[TYPEIT  (DMA NXM)
		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]

;ADD CODE HERE IN THE FUTURE

KDILS1:	POPJ	P,0
;HERE FOR PROCESSING CPU STATUS BLOCK

CSBST:	MOVE	T1,WKBUFF+CSBAPI	;GET THE APRID WORD
	ANDI	T1,7777			;GET THE SN ALONE
	CAIG	T1,^D1000		;KL SN IS >1000
	 JRST	KICSB			;DO A KI
	POPJ	P,0			;DO A KL

KICSB:	PUSHJ	P,.TCRLF
	TYPEIT	< APRID >
	MOVE	T1,WKBUFF+CSBAPI
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	TYPEIT	< CONI APR >
	MOVE	T1,WKBUFF+CSBAPR
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	TYPEIT	< CONI PI >
	MOVE	T1,WKBUFF+CSBPIC
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	TYPEIT	< DATAI PAG >
	MOVE	T1,WKBUFF+CSBPGD
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	TYPEIT	< CONI PAG >
	MOVE	T1,WKBUFF+CSBPGC
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	TYPEIT	<UPT LOCATIONS 424 THRU 427>
	MOVE	P2,[XWD -4,CSBUP0]
	PUSHJ	P,COLOUT
	JRST	ABORT

;HERE WE PROCESS KL CPU STATUS BLOCK ENTRIES
;ADDED BY EDIT 740

KLCSBA:	PUSHJ	P,.TCRLF		;[754]
	TYPEIT <CONI RH0 THRU RH7 >
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -8,CSBRHC]
	PUSHJ	P,COLOUT
	TYPEIT <CONI DTE0 THRU DTE3 >
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -4,CSBDTC]
	PUSHJ	P,COLOUT
	TYPEIT <EPT LOCATIONS 0 THRU 37 (CHANNEL LOGOUT AREA)>
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -40,CSBEP0]
	PUSHJ	P,COLOUT
	TYPEIT <EPT LOCATIONS 140 THRU 177 (DTE CONTROL BLOCKS)>
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -40,CSBEP1]
	PUSHJ	P,COLOUT
	TYPEIT <UPT LOCATIONS 424 THRU 427 (UUO AREA)>
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -4,CSBUP0]
	PUSHJ	P,COLOUT
	TYPEIT <UPT LOCATIONS 500 THRU 503 (PAGE FAIL AREA)>
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -4,CSBUP1]
	PUSHJ	P,COLOUT
	TYPEIT <AC BLOCK 6 LOCATIONS 0 THRU 3 AND 12>
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -5,CSBAC6]
	PUSHJ	P,COLOUT
	PUSHJ	P,.TCRLF		;[754]
	TYPEIT	<AC BLOCK 7 LOCATIONS 0 THRU 2>
	PUSHJ	P,.TCRLF
	MOVE	P2,[XWD -3,CSBAC7]
	PUSHJ	P,COLOUT
	POPJ	P,0

KLCSBB:	PUSHJ	P,.TCRLF
	PUSHJ	P,.TCRLF
	TYPEIT	<SBDIAG FUNCTIONS>
	PUSHJ	P,.TCRLF
	TYPEIT	<	CTRLR	FUNCTION 0	FUNCTION 1>
	MOVE	P2,WKBUFF+CSBSBD ;OFFSET > 77 -- PROCESSOR CAN'T GET IT [753]
	PUSHJ	P,SBDOUT
	POPJ	P,0
;HERE FOR DEVICE STATUS BLOCK PROCESSING

DSB00A:	PUSHJ	P,.TCRLF
	HRRZ	T1,WKBUFF+DSBIOI	;MAKE SUB-BLOCK PTR
	ADDI	T1,WKBUFF
	MOVEM	T1,SUBLK1		;SAVE IT
	HRRZ	T1,WKBUFF+DSBRSV
	ADDI	T1,WKBUFF
	MOVEM	T1,SUBLK2
DSB00B:	HLLZ	P4,WKBUFF+DSBIOI	;GET COUNT
DSB00C:	HRRZ	T3,SUBLK1		;GET THE BLOCK ADDR
	HRRZ	T2,P4
	ADD	T3,T2			;ADD BLOCK ADDR AND OFFSET
	MOVE	T4,0(T3)		;GET THE DATA WORD
	PUSH	P,T4			;SAVE IT
	LDB	T2,[POINT 3,T4,12]	;GET IO INSTR TYPE
	MOVE	T1,IOINAM(T2)		;GET SIXBIT TEXT
	PUSHJ	P,.TSIXN
	PUSHJ	P,.TSPAC
	POP	P,T4			;GET WORD BACK
	LDB	T1,[POINT 7,T4,9]	;GET DEVICE CODE
	LSH	T1,2			;MOVE IT OVER
	PUSHJ	P,.TOCTW		;PUT OUT IN OCTAL
	PUSHJ	P,.TSPAC
	PUSHJ	P,.TCOLN
	PUSHJ	P,.TSPAC
	HRRZ	T3,SUBLK2		;GET OTHER BLOCK ADDR
	HRRZ	T2,P4
	ADD	T3,T2
	MOVE	T1,0(T3)		;GET THE WORD
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	AOBJN	P4,DSB00C		;DONE
	POPJ	P,0			;YES



IOINAM:	SIXBIT	/BLKI/
	SIXBIT	/DATAI/
	SIXBIT	/BLKO/
	SIXBIT	/DATAO/
	SIXBIT	/CONO/
	SIXBIT	/CONI/
	SIXBIT	/CONSZ/
	SIXBIT	/CONSO/
;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 [523]
	 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 [523]
	PUSHJ	P,.TSIXN		;IN SIXBIT
;THE FOLLOWING INSTRUCTIONS TAKEN OUT IN EDIT [1311], INFO NOT SUPPLIED.
;
REPEAT 0,<
	TYPEIT	<  # >
	HLRZ	T1,P2			;GET DEV #
	TRZ	T1,1B18			;CLR THE I DON'T KNOW BIT
	PUSHJ	P,.ODECW		;WITH A .
	PUSHJ	P,.TCRLF
>;END OF REPEAT 0  -  EDIT [1311]
	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)
	JRST	ABORT			;DONE	[1342]


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

FEHNAM:	SIXBIT/KLCPU/			;200
	SIXBIT/KLERR/			;201
	SIXBIT/DTE/			;202 - DEX/EBUS FAILURES  [1311]
	SIXBIT/RH11/			;203 RH11 ERROR  [1311]
	SIXBIT/DM11BB/			;204 [1320]
	SIXBIT/UNK/			;205			START EDIT [523]
	SIXBIT/UNK/			;206
	SIXBIT/UNK/			;207
	SIXBIT/KLINIK/			;210
	SIXBIT/UNK/			;211			END EDIT [523]

FE%005:	0,,FE$KLS			;KL RELOAD REPORT FROM FRONT END
	0,,FE$KLF			;KLERROR FILE DUMP
	0,,FE$DTE			;202 DEX/EBUS FAILURES [1311]
	0,,FE$RJP			;203 RH11 [1311]
	0,,FE$DM1			;204 [1320]
	0,,FE$UNK			;205			START EDIT [523]
	0,,FE$UNK			;206
	0,,FE$UNK			;207
	0,,FE%KLI			;KLINIK EVENT - SHOULD NEVER COME HERE
	0,,FE$UNK			;211			END EDIT [523]


FE%003:	0,,FE$UNK
	0,,FE$UNK
	0,,FE$DL1			;DL11 [1311]
	0,,FE$DH1			;DH11 ROUTINE
	0,,FE$DLL			;DATA LINE SCANNER [1311]
	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	P1,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


;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
;ROUTINE TO LIST DATA LINE SCANNER ERRORS [1311]

FE$DLL:	MOVEI	T1,34			;MAGIC NUMBER FOR STANDARD STATUS (TOPS-10)
	MOVEM	T1,KONTYP		;SAVE IT
	JRST	FE$DLS			;DO IT (FOUND IN LIB)
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
	PUSH	P,T1			;AGAIN [1311]
	PUSHJ	P,.TOCTW
	MOVEI	T1,34			;CORRECTOFFSET
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION
;
; CHECK FOR CONFIGURATION BIT [1311]
;
	POP	P,T1			;GET THE WORD BACK [1311]
	TRNE	T1,FE.CFG		;CONFIGURATION REPORT ?
	JRST	LP$CFG			;YES [1311]

;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,35			;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 REGISTERSTO 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:	36,,0
	37,,0
	-1,,NOTRAN##
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,LPCLST
	-1,,LPDLST
;DH11 ROUTINES

FE$DH1:	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,34			;CORRECT OFFSET
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	PUSH	P,P1			;AND SAVE IT STILL
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION
	POP	P,P2			;GET THE WORD BACK
	POP	P,P1			;AND THE POINTER
	TRNE	P2,FE.CFG		;CONFIGURATION REPORT ? [1311]
	JRST	DH$CFG			;YES, GO REPORT IT [1311]
	TRNN	P2,1B25			;LOST INTERRUPT?
	 JRST FE$DHB			;MUST BE DEV HUNG.
;	TYPEIT	<
;	PAGE ADDR OF DH WHICH FAILED:	>
;	LDB	T1,[POINT 16,(P1),31]	;GET NEXT WORD
;	PUSHJ	P,.TOCTW		;DUMP IN OCTAL
;	POPJ	P,0			;THAT'S ALL TO LIST

;START EDIT [1257]
FE$DH2:	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,44			;[1331] 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,45			;[1331] 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 [1257]

FE$DHB:	TYPEIT	<
	CONTENTS OF COUNTERS:	>
	LDB	T1,[POINT 16,(P1),31]	;GET ONE
	PUSHJ	P,.TOCTW		;LIST IT
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	LDB	T1,[POINT 16,1(P1),15]	;2ND
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	LDB	T1,[POINT 16,1(P1),31]	;3RD
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	LDB	T1,[POINT 16,2(P1),15]	;4TH
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	POPJ	P,0			;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,34			;CORRECTOFFSET
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	POP	P,P1			;GET THE WORD BACK
	PUSH	P,P1			;SAVE IT FOR EDIT [1311]
	PUSHJ	P,CNIDCD		;1 FOR ONE XLATION
	POP	P,P1			;GET THE WORD BACK [1311]
	TRNE	P1,FE.CFG		;CONFIGURATION REPORT ? [1311]
	JRST	CD$CFG			;YES, GO REPORT IT [1311]
;NOW FOR 2ND STATUS BYTE
	TYPEIT	<
	CD20 GEN STATUS:	>
	POP	P,P1			;GET POINTER BACK
	PUSH	P,P1			;SAVE IT STILL
	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,40			;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,41			;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 REGISTERSTO 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
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,34			;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
	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,43			;OFFSET
	MOVEM	T1,KONTYP		;SETUP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
	POP	P,P1			;GET POINTER BACK
	POPJ	P,0			;THAT'S ALL
;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!  [744]

;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	T1,[POINT 8,4(P1),7]	;NO! - GET LIMIT
;TRANSLATE 11 LIMIT WORD TO AGREE WITH THOSE FOR
; MODE IN RING ACCEPTED
	IDIVI	T1,3			;1,3,7 TO 0,1,2
	ADDI	T1,1			;0,1,2 TO 1,2,3
	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	<EVENT CODE ERROR !!!!>	;NO! - HUH!
	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
>
;	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			;IF 0,
	 JRST KLFCN1			;DON'T LIST
	TYPEIT	<
	EXCEPTION CODE:	>
	MOVE	T1,KLEFIL(P1)		;GET THAT VALUE
	PUSHJ	P,.TOCTW		;IN DECIMAL
	TYPEIT	< = >
	TRNN	P2,1B35
	JRST	.+3
	TYPEIT	<CLK STOP,>
	TRNN	P2,1B34
	JRST	.+3
	TYPEIT	<DRAM PAR,>
	TRNN	P2,1B33
	JRST	.+3
	TYPEIT	<CRAM PAR,>
	TRNN	P2,1B32
	JRST	.+3
	TYPEIT	<FAST MEM PAR,>
	TRNN	P2,1B31
	JRST	.+3
	TYPEIT	<FIELD SERVICE STOP,>
	SKIPE	P2
	JRST	.+3
	 TYPEIT	<NONE>
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/SYSERC/]	;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 031 FROENT END RELOAD
;P2 HAS R1%NUM

R1%000:	TYPEIT	<
	CPU # :,,FRONT END #:	>
	MOVEI	T1,[ASCIZ/PRIVILEGED  /]
	TLZE	P2,1B18			;IS IT?
	 PUSHJ	P,.TSTRG		;YUP
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	MOVE	P3,WKBUFF+R1%STS	;GET STATUS WORD
	TYPEIT	<
	STATUS AT RELOAD:	>
	MOVE	P1,P3
	MOVEI	T1,42			;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
	POPJ	P,0
DEVTYP:0
	0
	SOFTDV
	TM10DV
	RH10DV
	0				; RESERVED FOR RH20DV
	DX10DV
	TC10DV
	DL10DV
	DL11DV
	KL1ADV
	KIADEV
	0
	0
	0
	0
	RP04SR
	RP04ER
	RP04CB
	RP04DA
	RS04SR
	RS04ER
	TU16SR
	TU16ER
	ICPCX1
	DXTAGB
	DXSB03
	DXSB47
	FESTDV
	FELPDV
	LPSADV
	LPSBDV
	FECDDV
	CDSTDV
	RLD1DV
	FEKLDV
	SCRDV
	NRCDV



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

BLKIND:	TRNE	P3,7777			;EDIT 132  FUNNY NAME?
	 PUSHJ	P,FIXNAM		;GO FIX
	MOVE	T1,[IOWD NAMLTH,NAMTBL];P3 ALREADYSETUP
	PUSHJ	P,.NAME			;LETSCANDO WORK
	  POPJ	P,			; LET CALLER HANDLE ERROR
	TLZ	T1,-1			;CLR LH
	SUBI	T1,NAMTBL		;T1 NOW = OFFSET
	MOVE	P3,BKLOC(T1)		;SETUP P3 TO RETURN
	AOS	(P)			;AND GIVESKIP
	POPJ	P,			;RETURN
	SUBTTL	OUTPUT LISTING RELATED ROUTINES
;BCKXXX -- SUBROUTINES TO DETERMINE LISTING AND SUMMATION ELIGIBILITY
;BASED ON BITS IN ENTCHR TABLE
;CALL	PUSHJ	P,@BITCHK(ERROR CODE)
;
;RETURN	CALL+1 TO LIST
;	JRST	ABORT TO GO TO NEXT ENTRY

BCK51:
BCK52:
BCK54:
BCK55:
BCK56:
BCK57:

BCK60:
BCK61:
BCK62:
BCK63:
BCK64:
BCK66:
BCK67:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)
	TLNN	F,F.DEV
	 JRST	BCKB
	MOVE	T1,[SIXBIT/KLCPU/]
	CAMN	T1,DEV
	 JRST	BCKA
	MOVE	T1,[SIXBIT/KSCPU/]
	CAMN	T1,DEV
	 JRST	BCKA
	MOVE	T1,[SIXBIT/KICPU/]
	CAMN	T1,DEV
	 JRST	BCKA
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV
	 JRST	ABORT
BCKA:	TLO	P2,E.LALL
BCKB:	TLNE	P2,E.LALL		;WANTS ALL?
	 POPJ	P,0
	TLNE	P2,E.LPAR		;/CPUPAR?
	 POPJ	P,0
	JRST 	ABORT

;START [705-RLD] TO MAKE CHECKS BEEFORE ASSEMBLYING PACKET
;MORE FIXES FOR KLERR WITH EDIT  [1235]

BCK30:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)		;CHARACTERISTICS OF ENTRY
	TLNE	P2,E.LSUM		;CHECK FOR SUMMARY
	 PUSHJ	P,SUM030		;DO SUMMARY NOW
	HRRZ	T1,WKBUFF+FE%COD ;GET DEVICE CODE
	CAIE	T1,.KLERR		;IF NOT KLERR
	JRST	BC030X			; 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	BC030X			; PROCEED NORMALLY
	TRNN	F,F.REM			;IF NOT REMOTE
	JRST	ABORT			; ABORT
;[1266]	REMOVED TO FIX 30-201 ENTRIES FROM GOING /REMOTE UNLESS ASKED FOR
;	POPJ	P,0		; ELSE FORCE TRANSFER
BC030X:	TLNN	F,F.DEV			;SAID /DEV:?
	 JRST	BC030A			;NOPE
	HRRZ	T1,WKBUFF+FE%COD	;DEVICE CODE
	CAILE	T1,^D256		;MAX I RECOGNIZE
	 JRST	BC030B			;OPPS
	CAIL	T1,200			;HARDWARE DEVICE?
	 JRST	BC030C			;NOPE
	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
BC030A:	TLNE	P2,E.LALL		;LIST ALL?
	POPJ	P,0			;[1226]
	TLNE	P2,E.LPER		;LIST PERFORMANCE
	POPJ	P,0			;[1226]
	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			;[1226]

BC030B:	WARN	<UNKNOWN DEV TYPE FOUND IN CODE 030 ENTRY-ABORTING ENTRY>
	JRST	ABORT
BC030C:	SUBI	T1,200			;REMOVE OFFSET
	MOVE	T1,FEHNAM(T1)		;A HIGHER NAME
	CAME	T1,DEV			;MATCH?
	 JRST	BC030D			;CHECK FURTHER
	TLNE	F,F.OSUM		;ANY LISTING CALLED FOR?
	 TLO	P2,E.LALL		;NO-FORCE LISTING
	JRST	BC030A			;AND CONTINUE
BC030D:	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	BC030A			;AND CONTINUE


;BC030E REMOVED AND
;MOVED KLE200 & KLE201 TO SYRLIB WITH EDIT  [1226]
BCK31:	MOVE	P1,ERTYPE	
	MOVE	P2,ENTCHR(P1)		;CHARACTERISTICS OF ENTRY
	PUSH	P,P2			;SAVE P2
	TLNE	P2,E.LSUM		;WANT SUMMARY?
	 PUSHJ	P,SUM031		;GO DO IT
	POP	P,P2			;RESTORE P2
	TLNN	F,F.DEV			;EDIT 211-SAID /DEV:?
	 JRST	BC031A			;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
BC031A:	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


BCK33:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)		;get entry characteristics
	TLNN	F,F.DEV			;said /dev: ?
	 JRST	BCK33A			;no, continue
	MOVE	T1,[SIXBIT/KSCPU/]
	CAME	T1,DEV			;match ?
	 JRST	ABORT			;no, exit
	TLO	P2,E.LALL		;force listing
BCK33A:	TLNE	P2,E.LALL		;WANTS ALL?
	 POPJ	P,0			;yes
	TLNE	P2,E.LPAR		;/CPUPAR?
	 POPJ	P,0			;yes
	JRST 	ABORT			;ttttthats all folks
SUM063:
SUM064:
SUM031:
SUM033:	POPJ	P,0			;NOTHING TO SUMMATE


SUM030:	HRRZ	T2,WKBUFF+FE%COD	;GET DEVICE CODE
	CAILE	T2,^D256		;IN RANGE?
	 JRST	BC030B			;NOPE
	CAIL	T2,200			;HARDWARE DEVICE
	 JRST	SUM13A
	CAILE	T2,11			;CURRENT LIMIT
	 MOVEI	T2,11			;SAY UNKNOWN
	AOS	NUM030(T2)		;BUMP COUNTER
	POPJ	P,0			;AND GO BACK
	
SUM13A:	SUBI	T2,200			;REMOVE OFFSET
	CAIN	T2,001			;IF KLERROR
	 JRST	SUM13B			;CHECK FOR LAST PACKET
	AOS	NUH030(T2)		;BUMP & GO
	POPJ	P,0
SUM13B:	HRRZ	T1,WKBUFF+FE%OFF
	ADDI	T1,WKBUFF
	LDB	T3,[POINT 16,0(T1),15]	;STD STATUS
	TRNE	T3,1B30			;EOF?
	 AOS	NUH030(T2)		;YES,NOW COUNT IT
	POPJ	P,0
;SUMUPD -- SUBROUTINE TO AUTOMATICALLY UPDATE ALL PERMANENT
;SUMMARY COUNTERS PRIOR TO SUMMARY LISTING
;A DUMMY MACRO DUMFLG IS USED TO GENERATE
;THE NECESSARY CODE AS FOLLOWS
;SKIPE	T1,XXXTMP	;PICKUP TEMP COUNTER
;ADDM	T1,XXXPER	;INCREMENT PERM COUNTER
;DO NEXT COUNTER SAME.......
;modified by edit #110
	DEFINE	TBLFLG(A)<
	setz	t1,
	exch	t1,A'TMP
	ADDM	T1,A'PER
>

;NOW THE ACTUAL CODE GENERATION

;	XLIST
SUMUPD:	DUMFLG
	LIST


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

	POPJ	P,			;RETURN


	SUBTTL	STORAGE LOCATIONS
DUMDAY:	121165				;DUMMY NBS DAY FOR USE BY SCAN
KONMSK:	0				;MASK FOR ERROR BITS IN RC10 TYPE DEVICE
	0				;MASK FOR ERROR BIT IN A RP10 TYPE DEVICE
	SFMASK				;SOFTWARE DETECTED ERROR MASK
	TMMASK
	RHMASK
	0				;RES FOR RH20SK
	DXMASK
	TCMASK
	DL1MSK
	DL2MSK
	KLAMSK
	KIAMSK
	0
	0
	0
	0
	P4SRSK
	P4ERSK
	P4CBSK
	P4DASK
	S4SRSK
	S4ERSK
	T6SRSK
	T6ERSK
	ICPCSK
	DXTBSK
	SB03SK
	SB47SK
	FESTSK
	FELPSK
	LPSASK
	LPSBSK
	FECDSK
	CDSTSK
	RLD1SK
	FEKLSK
	SCRMSK
	NRCMSK


MINERB:	0
	0
	MINSFB
	MINTMB
	MINRHB
	0				;RES FOR MIRH20
	MINDXB
	MINTCB
	MINDL1
	MINDL2
	MINKLA
	MINKIA
	0
	0
	0
	0
	MIRP01
	MIRP02
	MIRP10
	MIRP15
	MIRS01
	MIRS02
	MIT601
	MIT602
	MIICPC
	MIDXTB
	MISB03
	MISB47
	MIFEST
	MIFELP
	MILPSA
	MILPSB
	MIFECD
	MICDST
	MIRLD1
	MIFEKL
	MINSCR
	MINNRC


ERINDX:	0
	0
	0				;SFINDX
	0				;TMINDX
	0				;RHINDX
	0				;0	;RES FOR RH20DX
	0				;DXINDX
	0				;TCINDX
	0				;DL1IND
	0				;DL2IND
	KLAIND
	KIAIND
	0				;0
	0				;0
	0				;0
	0				;0
	0				;RP01DX
	0				;RP02DX
	0				;RP10DX
	0				;RP15DX
	0				;RS01DX
	0				;RS02DX
	0				;T601DX
	0				;T602DX
	0				;ICPCDX
	0				;DXTBDX
	0				;SB03DX
	0				;SB47DX
	FESTDX
	FELPDX
	LPSADX
	LPSBDX
	FECDDX
	CDSTDX
	RLD1DX
	FEKLDX
	SCRIND
	NRCIND



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

PDLPNT:	IOWD	LPDL,PDLST
	SUBTTL	DUMMY MACRO EXPANSION AREA


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

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

;THIS FIRST TABLE CONTAINS ALL THE ERROR  TYPES
;KNOWN TO ALL SYSERR PARTS. THE SECOND IS THE TABLE
;OF TYPES PROCESSED BY THE SEGMENT.
;EDIT #120.
	IFN	EXPPRT,<
	LALL
	>
	IFE	EXPPRT,<
	SALL
	>

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

ALLTBL:	DUMENT

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

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

ERRTBL:	0				;FIRST FOUND MUST NOT BE 0
	DUMENT

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


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

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


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

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


;GENERATE THE TEXT


TYPMES:	0
	DUMENT
	LIST

;END OF ENTRY DESCRIPTOR GENERATOR


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

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

BITCHK:	0
	DUMENT


;GENERATE THE TABLE OF LINE COUNTS FOR OUTPUT LISTING

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

	RADIX	10

LINE:	0
	DUMENT

	RADIX	8

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

	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>

>

.BR030:	BRF030
.CT030:	DUM030
	Z
.BR031:	BRF031
.CT031:	DUM031
	Z
.BR033:	BRF033
.CT033:	DUM033
	Z
.CT051:	DUM051
	Z
.BR051:	BRF051
.CT052:	DUM052
	Z
.BR052:	BRF052
.CT054:	DUM054
	Z
.BR054:	BRF054
.CT055:	DUM055
	Z
.BR055:	BRF055
.CT056:	DUM056
	Z
.BR056:	BRF056
.CT057:	DUM057
	Z
.BR057:	BRF057
.BR060:	BRF060
.CT060:	DUM060
	Z
.BR061:	BRF061
.CT061:	DUM061
	Z
.BR062:	BRF062
.CT062: DUM062
	Z
.BR063:	BRF063
.CT063:	DUM063
	Z
.BR064:	BRF064
.CT064:	DUM064
	Z
.BR066:	BRF066
.CT066:	DUM066
	Z
.BR067:	BRF067
.CT067:	DUM067
	Z


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

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


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




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

;TABLE FOR DISPATCH TO THE BYTE OPERANDS

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

;MAKE DISPATCH TABLE

BYTDSP:	DUMCH1
;NOW THE BYTES THEMSELVES


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


	DUMCH1



;SWITCH MACRO EXPANSION NEXT


;DEFINE THE SWITCHES WE RECOGNIZE

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

;CALL A MACRO TO SETUP DEFAULTS

	DEFVAL

;NOW MAKE SWTCHS MACRO FOR USE WITH DOSCAN LATER

	DEFINE	SWTCHS<
	DUMCH1
	DUMCH2
>

	DOSCAN(SWTAB)


	IFN	EXPPRT,<
	LALL
	>
	IFE	EXPPRT,<
	SALL
	>

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


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

	SOFTDV:	DUMSF1


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

	DEFINE	TBLDEV(A,B)<
	[ASCIZ\B',\]
>
	RP04SR:	DURP01
	RP04ER:	DURP02
	RP04CB:	DURP10
	RP04DA:	DURP15
	RS04SR:	DURS01
	RS04ER:	DURS02
	TU16SR:	DUT601
	TU16ER:	DUT602
	ICPCX1:	DUICPC
	DX10DV:	DUMDX1
	DXTAGB:	DUDXTB
	DXSB03:	DUSB03
	DXSB47:	DUSB47
	TC10DV:	DUMTC1
	DL10DV:	DUMDL1
	DL11DV:	DUMDL2
	KL1ADV:	DUMKLA
	KIADEV:	DUMKIA
FESTDV:	DUFEST
FELPDV:	DUFELP
LPSADV:	DULPSA
LPSBDV:	DULPSB
FECDDV:	DUFECD
CDSTDV:	DUCDST
RLD1DV:	DURLD1
FEKLDV:	DUFEKL
SCRDV:	DUMSCR
NRCDV:	DUMNRC

;NOW GENERATE THE ERROR BIT VS INDEX BIT TABLES
;USING THE TBLDEV MACRO

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	FESTDX+A-MIFEST
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
FESTDX:	REPEAT	36-MIFEST,<0>
	ZZ==0
	DUFEST

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	KIAIND+A-MINKIA
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
KIAIND:	REPEAT	36-MINKIA,<0>
	ZZ==0
	DUMKIA

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	RLD1DX+A-MIRLD1
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
RLD1DX:	REPEAT	36-MIRLD1,<0>
	ZZ==0
	DURLD1


	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	FELPDX+A-MIFELP
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
FELPDX:	REPEAT	36-MIFELP,<0>
	ZZ==0
	DUFELP

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	LPSADX+A-MILPSA
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
LPSADX:	REPEAT	36-MILPSA,<0>
	ZZ==0
	DULPSA

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	LPSBDX+A-MILPSB
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
LPSBDX:	REPEAT	36-MILPSB,<0>
	ZZ==0
	DULPSB


	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	FECDDX+A-MIFECD
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
FECDDX:	REPEAT	36-MIFECD,<0>
	ZZ==0
	DUFECD


	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	CDSTDX+A-MICDST
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
CDSTDX:	REPEAT	36-MICDST,<0>
	ZZ==0
	DUCDST



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

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	SCRIND+A-MINSCR
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
SCRIND:	REPEAT	36-MINSCR,<0>
	ZZ==0
	DUMSCR

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	NRCIND+A-MINNRC
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
NRCIND:	REPEAT	36-MINNRC,<0>
	ZZ==0
	DUMNRC

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	KLAIND+A-MINKLA
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
KLAIND:	REPEAT	36-MINKLA,<0>
	ZZ==0
	DUMKLA


;NOW GENERATE THE ERROR BIT VS INDEX BIT TABLES
;THIS ALLOWS NON-CONTIGUOUS ERROR BITS IN CONI WORD
;TO BE COUNTED IN CONTIGUOUS COUNTERS




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

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

MASNAM:	DUMFS
	DUMRP

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

;GENERATE LIST OF POINTERS TO 5 WORD SCRATCH BLOCKS

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

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

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

DEVDS2::
DEVDSP:	DUMDVA



	DEFINE	DUMDV(A)<
	XWD	A'ST,A'SP
>
;ST=STORAGE TEMP,SP=PERM.
SOFDSP:	DUMDVA
;NOW THE DISPATCHER FOR MASSBUS ERROR REGS

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



	END	STARTC