Google
 

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




	SEARCH	SYRUNV
	SEARCH	SYRLOW	;LOW SEG DEFINITIONS
	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<
	DUM002
	DUM004
	DUM011
	DUM015
	DUM021
	DUM042
	DUM050
>



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

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





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



	.JBVER==137
	LOC	.JBVER

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


	TWOSEG
	RELOC	400000


	;DUMMY TO COMPILE PACKAGE
MASNA2::
MASLT2==0
MDECHA:
KLEDMP:
	;PROCSA -- STANDARD ENTRY PROCESSOR #1
	;CALL	JRST PROCSA
	;
	;RETURN	JRST ABORT	WHEN ENTRY IS PROCESSED OR ABORTED
	;OPERATION IS CONTROLLED BY ENTRY IN CONTROL TABLE
	;ROUTINE GETS AOB POINTER TO DESIRED WORD IN BUFFER
	;IF THERE IS ONE PRESENT
	;THEN DISPATCHES TO WORD PROCESSOR LEVEL
	;VIA PUSHJ	P,SUBTAB(MODE)
	;PASSES BUFFER WORD IN P2 TO WORD PROCESSOR

PROCSB:	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,PROCSB	;GET NEXT WORD IN CTL TABLE
	CAILE	T2,WKSIZE	;MAKE SURE THE WORD ASKED FOR IS IN WORK BUFFER
	AOJA	CTINDX,PROCSB	;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,PROCSB	;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,PROCSB	;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

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

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


	;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



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

STARTB:	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
	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
	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>


	;NXMLST-- SPECIAL ROUTINE FOR KA/KI NXM LISTINGS
	;P2 HAS NXMKPG

NXMLST:	SETOM	KFLAG		;ASSUME K OF CORE
	TRNE	P2,1B35		;BUT CHECK
	 SETZM	KFLAG		;AND CHANGE IF NECESSARY
	TYPEIT	<
PHYSICAL MEMORY PLACED OFF-LINE:
>
	MOVE	P1,WKBUFF+NXMBEF	;GET PNTR TO FIRST TABLE
	PUSHJ	P,BLDPTR		;CORRECT IT
	MOVE	P2,P1			;SAVE IT
	MOVE	P1,WKBUFF+NXMAFT	;AFTER TABLE
	PUSHJ	P,BLDPTR
	PUSHJ	P,XORTAB	;FIND DIFFERENCES
	PUSHJ	P,BITLST	;LIST THOSE FOUND
	POPJ	P,0		;RETURN TO PROCSA

	;CSCLST-- ROUTINES TO DO CONFIG CHANGE ENTRIES
	;STARTS WITH CSCSTS IN P2

CSCLST:	TYPEIT	<	DEVICE:		>
	MOVE	T1,WKBUFF+CSCNAM	;GET A NAME
	TLNE	P2,1B32			;CONFIG CODE = 10-17?
	 MOVE	T1,[SIXBIT/MEMORY/]	;CHANGE THE DEV NAME
	PUSHJ	P,.TSIXN		;SAY IT
CSCLS1:	TYPEIT	<
	COMMAND:	>
	LDB	P1,[POINT 6,WKBUFF+CSCSTS,17]	;GET CONFIG CODE
	MOVEI	T1,[ASCIZ/ATTACH/]	;THAT'S A DEFAULT
	CAIN	P1,1			;BUT IF DET
	 MOVEI	T1,[ASCIZ/DETACH/]
	CAIN	P1,2			;EXCH?
	 MOVEI	T1,[ASCIZ/EXCHANGE WITH/]
	CAIN	P1,10			;MEM ON-LINE
	 MOVEI	T1,[ASCIZ/SET MEM ON-LINE/]
	CAIN	P1,11			;OFF-LINE?
	 MOVEI	T1,[ASCIZ/SET MEM OFF-LINE/]
	PUSHJ	P,.TSTRG		;SAY WHATEVER
	CAIE	P1,2			;EXCH?
	 JRST	CSCLS2			;NO GO AROUND
	TYPEIT	<  >
	MOVE	T1,WKBUFF+CSCNM2	;GET SECOND NAME
	PUSHJ	P,.TSIXN		;IN SIXBIT

CSCLS2:	LDB	P1,[POINT 12,WKBUFF+CSCSTS,11]	;GET A REASON
	SKIPN	P1			;ANYTHING THERE?
	 JRST	CSCLS3			;FORGET IT
	TYPEIT	<
	REASON:	>
	SETZ	T1,
	DPB	P1,[POINT 12,T1,11]	;MOVE IT OVER
	PUSHJ	P,.TSIXN
	POPJ	P,0

CSCLS3:	MOVE	P1,WKBUFF+CSCSTS
	TLNN	P1,1B32		;MEMORY INVOLVED
	 POPJ	P,0		;NO
	SETZM	KFLAG		;ASSUME PAGES
	TRNE	P1,1B35		;CHECK FOR K
	 SETOM	KFLAG		;FIX IT
	TYPEIT	<
MEMORY PLACED >
	MOVEI	T1,[ASCIZ/ON-LINE: /]
	TLNE	P1,1B35		;ON-LINE?
 	MOVEI	T1,[ASCIZ/OFF-LINE: /]
	PUSHJ	P,.TSTRG	;SAY IT
	PUSHJ	P,.TCRLF
	MOVE	P1,WKBUFF+CSCNAM	;POINTR TO TABLE BEFORE CHANGE
	PUSHJ	P,BLDPTR		;CORRECT IT
	MOVE	P2,P1			;SETUP
	MOVE	P1,WKBUFF+CSCNM2	;POINTR TO TABLE AFTER CHANGE
	PUSHJ	P,BLDPTR
	PUSHJ	P,XORTAB		;FIND DIFFERENCES
	PUSHJ	P,BITLST		;LIST THOSE FOUND
	POPJ	P,0


	;MSEJOB-- ROUTINE TO DUMP RESULT AND # JOBS
	;AFFECTED FOR CODE 2 ENTRIES

MSEJOB:	TYPEIT	<
	STOPCD NAME:	>
	HLLZ	T1,WKBUFF+MSESPC	;GET NAME BY ITSELF
	PUSHJ	P,.TSIXN		;IN SIXBIT
	MOVEI	T1,[ASCIZ/
	RESULT:		/]
	PUSHJ	P,.TSTRG	;OUTPUT MESSAGE
	MOVEI	T1,NDSTMP
	MOVEI	T2,NDSPER
	MOVE	T3,WKBUFF+MSENDS	;CURRENT COUNTS
	PUSHJ	P,COMPAR		;GO CHECK
	TLNN	F,F.CHNG		;DID IT CHANGE?
	JRST	MSEJB1			;NO-CHECK JOBS
	MOVEI	T1,[ASCIZ/CONTINUED SYSTEM/]
	PUSHJ	P,.TSTRG
MSEJB1:	MOVEI	T1,NJSTMP
	MOVEI	T2,NJSPER
	MOVE	T3,WKBUFF+MSENJS	;GET CURRENT
	PUSHJ	P,COMPAR		;GO CHECK
	TLNN	F,F.CHNG		;DID IT CHANGE?
	 POPJ	P,0			;GO BACK NOW
	MOVEI	T1,[ASCIZ/CRASHED JOB/]
	PUSHJ	P,.TSTRG	;GO SAY WHAT HAPPENED
	POPJ	P,0		;RETURN TO PROCSA	AND LIST
				;JOB INFORMATION FOR EITHER DEBUG
				;OR JOB STOPCD'S.


	;HERE CHECK FOR DETAIL SWITCH AND THEN DUMP CRASH AC'S ETC

MSEDET:	TLNN	F,F.DET	;SAID THE MAGIC WORD?
	 PJRST	TAPL11	;THAT WILL DO THE SAME THING.
	TYPEIT	<
	CONTENTS OF AC'S AT STOPCD:
>
	MOVEI	P1,MSEA00	;SETUP
	HRLI	P1,-20
	PUSHJ	P,ACLST		;[427]LIST
	TYPEIT	<

	PI STATUS:	>
	MOVE	T1,WKBUFF+MSEPIS	;GET THAT WORD
	PUSHJ	P,.TXWDW
	PUSHJ	P,TITLST		;START ON NEXT PAGE
	POPJ	P,0			;GO BACK



	;ROUTINES TO SPECL LISTING FOR CODE 50 ENTRIES
	;ER.DLE  DL10 HARDWARE ERRORS

DLELST:	TYPEIT	<
	UNIT:	>
	HLRZ	T1,WKBUFF+DLESTS
	CAILE	T1,7		;IN RANGE?
	 JRST	DLELS1		;OPPPS
	SKIPN	T1
	 JRST	DLELS1		;0?
	MOVE	T1,DLETYP(T1)
	PUSHJ	P,.TSTRG	;SAY TYPE FE

DLELS2:	TYPEIT	<
	DL10 PORT:	>
	HRRZ	T1,WKBUFF+DLEPRT
	PUSHJ	P,.TOCTW
	TYPEIT	<
	ERROR:	>
	MOVEI	T1,11		;MAGIC # FOR DL10 DATAI DLC
	MOVEM	T1,KONTYP
	MOVE	P1,WKBUFF+DLEDTI	;SETUP
	PUSHJ	P,CNIDCD
	PUSHJ	P,.TCRLF
	POPJ	P,0		;RETURN TO PROCSA

DLELS1:	TYPEIT	<UNKNOWN>
	JRST	DLELS2		;THAT'S EASY ENOUGH

DEVCOD:	;0	;ADD IT HERE

DLETYP:	0
	[ASCIZ/	DC76/]
	[ASCIZ/	DC44/]
	[ASCIZ/	DC44&DC76/]
	[ASCIZ/	DECSYNC DC75/]
	[ASCIZ/	DAS78/]
	[ASCIZ/	DC75-DDCMP/]
	[ASCIZ/ DAS85/]


	;HERE DECODE DL10 CONI AND DATAI
	;CONI IS ALREADY IN P2
DLEDCD:	TYPEIT	<
CONTROLLER INFORMATION:
	CONI DLC:	>
	MOVE	T1,P2
	PUSHJ	P,.TXWDW
	MOVEI	T1,10		;OFFSET FOR DL10 CONI
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	MOVE	P1,P2	
	PUSHJ	P,CNIDCD	;GO TRANSLATE
	TYPEIT	<
	DATAI DLC:	>
	MOVEI	T1,11		;OFFSET FOR DATAI DLC
	MOVEM	T1,KONTYP
	MOVE	P1,WKBUFF+DLEDTI	;GET DATAI WD
	MOVE	T1,P1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	PUSHJ	P,CNIDCD	;TRANSLATE
	POPJ	P,0		;TO PROCSA



	;HERE TO DUMP 11 BASED INFO IF DESIRED
DLELEI:	TLNN	F,F.DET		;SAID /DETAIL?
	 PJRST	TAPL11		;WIL TYPE MESSAGE & RETURN
	TYPEIT	<
11 BASED INFORMATION:
>
	HRRZ	P1,WKBUFF+DLESTS	;GET 11 PC WD
	SKIPN	P1
	 JRST	DLELE1			;DONT IF 0
	TYPEIT	<	11 PC:	>
	MOVE	T1,P1
	PUSHJ	P,.TOCTW		;IN OCTAL
	PUSHJ	P,.TCRLF
DLELE1:	HRRZ	P1,WKBUFF+DLEERR	;GET FAILURE CODE
	SKIPN	P1
	 JRST	DLELE2			;AGAIN NOT IF 0
	TYPEIT	<	11 FAILURE CODE:	>
	MOVE	T1,P1
	PUSHJ	P,.TOCTW
	MOVEI	T1,34			;OFFSET FOR THIS CODE WORD
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD		;TRANSLATE
	PUSHJ	P,.TCRLF
DLELE2:	HRRZ	P1,WKBUFF+DLERHS	;GET 11 DL10 STATUS
	SKIPN	P1
	 JRST	DLELE3
	TYPEIT	<	11 STATUS FROM DL10:	>
	MOVE	T1,P1
	PUSHJ	P,.TOCTW
	MOVEI	T1,35			;CORRECT OFFSET
	MOVEM	T1,KONTYP
	TYPEIT	< = >
	PUSHJ	P,CNIDCD		;TRANSLATE THIS TOO
	PUSHJ	P,.TCRLF
DLELE3:	MOVE	P1,WKBUFF+DLECOD	;GET 11 STOPCD WORD
	SKIPN	P1
	 JRST	DLELE4
	TYPEIT	<	11 STOPCD:	>
	MOVE	T1,P1
	PUSHJ	P,.TSIXN		;IN SIXBIT
	PUSHJ	P,.TCRLF
DLELE4:	HLRZ	P1,WKBUFF+DLEPER		;PERIPHERAL?
	SKIPN	P1
	 PJRST	TITLST			;START ON NEXT PG & RETURN
					;TO PROCSA
	TYPEIT	<	11 DEV:	>
	MOVE	T1,DEVCOD(P1)		;ASCIZ ADDR
	PUSHJ	P,.TSTRG
	TYPEIT	<
	11 DEV STATUS:	>
	HRRZ	T1,WKBUFF+DLEPER	;GET DEV'S STATUS REGISTER
	PUSHJ	P,.TOCTW		;IN OCTAL AND NO TRANSLATION
	PJRST	TITLST			;THATS ALL-START ON NEXT PAGE 
					;THEN RETURN TO PROCSA

	;TMEA -- ROUTINE TO LIST ERROR CODE 20 ENTRIES.

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



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

FUNMSG:	[ASCIZ\	NO-OP\]

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

DENMSG:	[ASCIZ\	200 BPI,\]
	[ASCIZ\	556 BPI,\]
	[ASCIZ\	800 BPI,\]
	[ASCIZ\	800 BPI,\]


	;EPELOR-- ROUTINE TO BUILD LOGICAL ANDS & ORS
	;OF PDP11 WORDS.  CAN HANDLE TWO SEPERATE WORDS PER CALL
	;SETUP	P1= WORDS TO BE ANDED & ORED
	;	P2=ADDRESS OF WHERE TO BUILD THE LOGICALS
	;	   LH=ADDRESS FOR ANDS
	;	   RH=ADDRESS FOR ORS. EITHER = 0 THEN CORRESPONDING
	;		HALF OF P1 IS LEFT ALONE
	;NOTE P2 IS LEFT UNTOUCHED TO FACILITATE REPEAT CALLS
	;CALL-- PUSHJ	P,EPELOR
	;RTN -- CALL+1
	;USES T1-T4

EPELOR:	HRRZ	T3,P2			;SETUP	INDEX FOR LH WORD
	HLRZ	T4,P2			;AND RH
	SKIPN	T3			;WORK ON LH?
	 JRST 	EPEL.1			;NO
	HLRZ	T1,P1			;LOG AND FIRST
	HLRZ	T2,0(T3)		;GET PREVIOUS RESULT
	AND	T2,T1			;DO IT
	HRLM	T2,0(T3)		;PUT AWAY NEW ANS
	HRRZ	T2,0(T3)
	IOR	T2,T1			;DO IT AGAIN
	HRRM	T2,0(T3)		;PUT AWAY NEW OR
	
EPEL.1:	SKIPN	T4			;WORK ON RH?
	 POPJ	P,0			;NO GO BACK
	HRRZ	T1,P1			;GET RH ALONE
	HLRZ	T2,0(T4)			;GET OLD ANS
	AND	T2,T1			;AGAIN
	HRLM	T2,0(T4)		;PUT IT BACK
	HRRZ	T2,0(T4)			;GET OLD OR
	IOR	T2,T1			; LAST TIME
	HRRM	T2,0(T4)		;PUT IT AWAY
	POPJ	P,0			;RETURN TO CALLER
	;MDELST--	ROUTINES TO DO MOST OF THE WORK TO LIST
	;CODE 11 ENTRIES, MASSBUS DEVICE ERRORS.
	;DEVICE TYPE WORD IS IN P2 WHEN WE GET HERE
	;CALLED VIA PUSHJ FROM PROCSA RETURNS POPJ SEVERAL
	;PAGES FROM HERE.

MDE000:	SIXBIT/RS04/
	SIXBIT/TU16/
	SIXBIT/RP04/
	SIXBIT/RP05/
	SIXBIT/RP06/

MDELST:	SETZB	T2,MDEDTP
	HRRZ	T1,P2			;GET TYPE ALONE
	ANDI	T1,77			;STRIP IT OFF
	TRNE	T1,2			;RS04?
	MOVEI	T2,0			;SAY SO
	TRNE	T1,20			;RP04?
	MOVEI	T2,2			;SAY SO
	CAIN	T1,21			;RP05?
	 MOVEI	T2,3			;YES
	CAIN	T1,22		;RP06?[310]
	 MOVEI	T2,4		;YES
	SKIPN	,T2		;ANYTHING THERE? EDIT 142
	 PUSHJ	P,MDEXX1		;NO-GO LOOK AT DEVICE NAMES
	MOVEM	T2,MDEDTP		;AND SAVE IT (POOR GUY REALLY
					;GET SHOVED AROUND!)
	TYPEIT	<
	UNIT TYPE:	>
	MOVE T1,MDEDTP			;GET TYPE BACK
	MOVE	T1,MDE000(T1)		;GET IT IN SIXBIT
	PUSHJ	P,.TSIXN
	MOVS	P1,WKBUFF+MDEDSN	;GET SER # WORD
	SKIPN	P1		;ANYTHING THERE?
	JRST	MDE001			;GO AROUND
	TYPEIT	<
	UNIT SERIAL #:	>
	HLRZ	T1,P1
	ANDI	T1,170000		;GET MSD
	LSH	T1,-14			;SHOVE IT DOWN
	PUSHJ	P,.TDECW		;OUTPUT IT
	HLRZ	T1,P1
	ANDI	T1,07400		;GET NEXT DIGIT
	LSH	T1,-10
	PUSHJ	P,.TDECW
	HLRZ	T1,P1			;GET NEXT DIGIT
	ANDI	T1,00360		;MASK IT OFF
	LSH	T1,-4
	PUSHJ	P,.TDECW		;OUTPUT IT
	HLRZ	T1,P1			;GET LSD
	ANDI	T1,0017			;STRIP
	PUSHJ	P,.TDECW
	TYPEIT	<.>
MDE001:	TYPEIT	<
	MEDIA ID:	>
	MOVE	T1,WKBUFF+MDEMID		;THAT'S WHERE IT SHOULD BE
	PUSHJ	P,.TSIXN			;IN SIXBIT
	MOVE	T1,MDEDTP			;IS THIS A MAGTAPE?
	CAIN	T1,1
	  JRST 	MDE002				;YES
	TYPEIT	<
	STR ID:		>
	MOVE 	T1,WKBUFF+MDESTR		;GO GET IT
	PUSHJ	P,.TSIXN
	JRST	MDE003				;GO AROUND MAGTAPE
MDE002:	TYPEIT	<
	USER'S ID:	>
	MOVE	T1,WKBUFF+MDEUID		;
	PUSHJ	P,.TPPNW			;
	;HERE TO OUTPUT FAILURE LOCATION

MDE003:	MOVE T1,MDEDTP				;GET DEV TYPE BACK
	CAIN	T1,1				;MAGTAPE?
	  JRST MDE007				;YUP
	
;HERE FOR LBN (RP04 OR RS04)
	TYPEIT	<
	LBN:		>
	MOVE 	T1,WKBUFF+MDELOC		;GET LBN
	PUSHJ	P,.TDECW			;TYPE IN DECIMAL
	TYPEIT	<.  =
	>
	MOVE T1,MDEDTP				;GET TYPE AGAIN
	SKIPN	T1	;RS04?
	  JRST	MDE004				;YES
	SETZ	P2,
	CAIN	T1,2		;RP04?
	 HRRZI	P2,5	;SAY SO
	CAIN	T1,3	;RP05?
	 HRRZI	P2,6		;SET INDEX TO POINT AT RP05
	CAIN	T1,4		;RP06?[310]
	 HRRZI	P2,7	;SAY SO
	MOVE	P3,WKBUFF+MDELOC
	CAMGE	P3,.MXBLK(P2)			;[144]1ST UNIT OF STR?
	 JRST	MDE005				;OK
	SUB	P3,.MXBLK(P2)			;- 1 UNITS WORTH
	JRST	.-3				;AND TRY AGAIN
MDE005:	TYPEIT	<CYL:   >
	IDIV	P3,.TRBLK(P2)			;GET CYL #
	MOVE	T1,P3
	PUSHJ	P,.ODECW			;SAY IT IN DECIMAL
	MOVE	P3,P4				;REMAINDER
	TYPEIT	<	SURF:   >
	IDIV	P3,.SUBLK(P2)			;SURFACE #
	MOVE	T1,P3
	PUSHJ	P,.ODECW			;AGAIN WITH ".".
	TYPEIT	<	SECT:   >
	MOVE	P3,P4				;REMAINDER
	IMUL	P3,.SECBK(P2)			;X BLOCKS/SECTOR
	MOVE	T1,P3
	PUSHJ	P,.ODECW
	JRST	MDE010				;GO AROUND MAGTAPE
	;HERE FOR LBN FOR RS04

MDE004:	MOVE	P3,WKBUFF+MDELOC		;GET LBN
	CAMGE	P3,.MXBLK+4			;[144]1ST UNIT IN STR?
	 JRST	MDE006				;YES-OK
	SUB	P3,.MXBLK+4			;-1 UNITS WORTH
	JRST	.-3				;TRY AGAIN
MDE006:	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	MDE010				;GO AROUND MAGTAPE

	;HERE FOR MAGTAPE FAILURE LOCATION
MDE007:	TYPEIT	<	LOCATION:    RECORD  #  >
	HLRZ	T1,WKBUFF+MDELOC
	PUSHJ	P,.ODECW
	TYPEIT	<    OF FILE #  >
	HRRZ	T1,WKBUFF+MDELOC
	PUSHJ	P,.ODECW
	
;HERE AFTER DUMPING FAILURE LOCATION - NOW TO DUMP
	;OPERATION ISSUED TO DEVICE
MDE010:	TYPEIT	<
	OPERATION AT ERROR:	>
	HRLZ	T1,WKBUFF+MDEICR	;GET ISSUED CONTROL REG.
	MOVE	T2,MDEDTP		;SETUPINDEX
	PUSHJ	P,@MDE011(T2)		; LET ROUTINE DO WORK

	;HERE TO DUMP USER'S INFORMATION
	TYPEIT	<
	USER'S ID:	>
	MOVE	T1,WKBUFF+MDEUID	;
	PUSHJ	P,.TPPNW
	MOVEI	P1,[ASCIZ/
	USER'S PGM:	/]
	MOVE	P2,WKBUFF+MDEPGM
	PUSHJ	P,.SIXBT
	MOVEI	T1,[ASCIZ/
	USER'S	FILE:	/]
	PUSHJ	P,.TSTRG
	MOVE	T1,WKBUFF+MDEFIL
	HLRZ	T2,WKBUFF+MDEEXT	;GET EXTENSION
	CAIN	T2,'UFD'		;UFD'S GET DIFFERENT TREATMENT
	 PUSHJ	P,[PUSHJ	P,.TPPNW
		   AOS		0(P)
		   POPJ		P,0]
	PUSHJ	P,.TSIXN
	MOVEI	P1,[ASCIZ/./]
	HLLZ	P2,WKBUFF+MDEEXT	;ONCE MORE
	PUSHJ	P,.SIXBT
	;HERE TO OUTPUT BASIC TRANSLATION OF CONI OR SOFTWARE ERROR
	;IF SOFTWARE ERROR (RIB ETC) S HAS BEEN SET UP AS A DUMMY
	;CONI WORD BY BIT CHECKING AND SUM ROUTINES.
	;MODIFIED BY EDIT 142 TO CHECK FOR SOFTWARE ERROR FIRST
	;AND DONT LIST MUCH IF IT WAS AS CONI,DATAI
	;ETC MAY BE MISLEADING(FROM PREVIOUS ERROR)
	;MODIFIED WITH EDIT 313 FOR RH20

	TYPEIT	<
	ERROR:	>
	MOVE	P3,MASKON	;CONTROLLER OFFSET, 4=RH10,5=RH20
	MOVEM	P3,KONTYP		;AND STORE IT
	MOVE	P2,WKBUFF+MDECNI	;GET CONI AT ERROR
	MOVE	P4,KONMSK(P3)		;AND MASK
	TDNN	P2,P4			;ANY ERROR BITS ON?
	 JRST	MDE013			;NO-MUST BE SOFTWARE
	MOVE	P2,WKBUFF+MDETYP	;GET DEVICE TYPE
	TLNE	P2,ERRHRD		;HARD ERROR?
	 MOVEI	T1,[ASCIZ/NON-RECOVERABLE /]
	TLNN	P2,ERRHRD		;TRY AGAIN
	 MOVEI	T1,[ASCIZ/RECOVERABLE /]	;NOW T1 IS SETUP FOR EITHER
	PUSHJ	P,.TSTRG		;SAY IT IN ASCIZ
	HLRZ	T1,P2			;GET CONTROLLER TYPE
	TRNN	T1,10			;RH10?
	 JRST	MDE012			;NOPE
	MOVEI	P3,4			;YUP - SETUP RH10INDEX
	MOVEM	P3,KONTYP		;AND STORE IT
	MOVE	P2,WKBUFF+MDECNI	;GET CONI AT ERROR
	MOVE	P4,KONMSK(P3)		;AND MASK
	AND	P2,P4			;YES GET ERROR BITS ALONE
	LSH	P2,@MINERB(P3)		;MOVE THEM OVER
	HRRZI	P4,RH10DV		;FINISH SETUP
	PUSHJ	P,JFLOOP		;GO DO TRANSLATION
	JRST	MDE014			;GO AROUND RH20 & SOFTWARE
MDE012:	MOVEI	P3,5		;SETUP
	MOVEM	P3,KONTYP		;STORE IT
	MOVE	P2,WKBUFF+MDECNI	;GET ERROR CONI
	MOVE	P4,KONMSK(P3)		;GET MASK
	AND	P2,P4			;ERROR BITS ALONE
	LSH	P2,@MINERB(P3)		;MOVE THEM OVER
	HRRZI	P4,RH20DV		; SETUP TABLE ADDR
	PUSHJ	P,JFLOOP		;HE'LL DOTHE WORK
	JRST	MDE014			;GO AROUND SOFTWARE
	;HERE TO SCREAM ABOUT SOFTWARE DET ERROR
MDE013:	SKIPN	S		;ANY SOFTWARE DETECTED ERRORS?
	 JRST	MDE13C		;NO-CHECK FOR OFFLINE'S
	TYPEIT	< NON-RECOVERABLE SOFTWARE DETECTED  >
	MOVEI	T1,2			;SOFTWARE INDEX
	MOVEM	T1,KONTYP
	MOVE	P2,S			;DUMMY CONI WORD
	LSH	P2,@MINERB(T1)		;MOVE OVER
	MOVE	P4,DEVTYP(T1)		;TABLE ADDR
	PUSHJ	P,JFLOOP
	JRST	MDE14A		;
;HERE COMPARE DEV NAME BECAUSE NO DRIVE TYPE
MDEXX1:	LDB	T3,[POINT 12,WKBUFF+MDENAM,11]
	CAIN	T3,6260		;RPX?
	 MOVEI	T2,2		;YES, RP04
	CAIN	T3,4663		;FSX?
	 MOVEI	T2,0		;YES, RS04
	POPJ	P,0
;END EDIT 142


	;[152]
MD013A:	TYPEIT	<    ***** EITHER MOL OR DRY OR BOTH BITS ARE OFF
		IN DEVICE STATUS REG *****>
	JRST	MDE014			;KEEP ON LISTING
MDE13C:	HRRZ	P2,WKBUFF+MDEDSR	;[152]GET DEVICE STATUR REG
	TRNE	P2,1B23			;EITHER MOL OR DRY
	TRNN	P2,1B28
	 JRST	MD013A			;IS OFF
	JRST	MDE014		;NONE-CONTINUE
	;CODE ADDED WITH EDIT 122

MDE014:	TYPEIT	< IN CONTROLLER CONI
		>
	HRLZ	P1,WKBUFF+MDEDER	;GET DEV ERROR REG
	MOVE	T1,MDEDTP		;AND DEV TYPE
	MOVEI	T2,21		;ASSUME RP04,5,OR6
	SKIPN	T1		;BUT CHECK
	 MOVEI	T2,25		;FOR RS04
	MOVEM	T2,KONTYP	;FINISH SETUP
	PUSHJ	P,CNIDCD	;TRANSLATE DEV ERROR REGISTER TOO
	TYPEIT	< IN DEVICE ERROR REGISTER>
	;END [326]
MDE14A:	LDB	P1,[POINT 9,WKBUFF+MDECCT,17]	;GET BAT SLOTS
	TYPEIT	<
	REMAINING ENTRIES IN
	UNIT'S BAT BLOCK:	>
	MOVE	T1,P1
	CAIN	T1,777		;UNKNOWN?
	 JRST 	MDE13A		;YES
	PUSHJ	P,.ODECW	;SAY IT IN DECIMAL
	JRST	MDE13B		;GO AROUND
MDE13A:	TYPEIT	<UNKNOWN>

	;HERE TO DUMP RETRIES AND CONTROLLER INFORMATION
MDE13B:	TYPEIT	<
	RETRY COUNT:	>
	HRRZ	T1,WKBUFF+	MDETYP	;GET RETRY COUNT
	PUSHJ	P,.ODECW		;TYPE # & .
	PUSHJ	P,DETCHK	;/DETAIL??
	TYPEIT	<
CONTROLLER INFORMATION:
	CONTROLLER:	>
	MOVE	P4,WKBUFF+MDETYP	;GET TYPE
	HLRZ	T2,P4
	TRNN	T2,10			;RH10?
	 MOVEI	T1,[ASCIZ/ RH20/]	;NO
	TRNE	T2,10
	 MOVEI	T1,[ASCIZ/ RH10/]	;YES
	PUSHJ	P,.TSTRG		;TYPE EITHER
	TYPEIT	<  #>
	HLRZ	T1,P4
	ANDI	T1,7			;GET CONTROLLER #
	PUSHJ	P,.TOCTW		;TYPE IT TOO
	TYPEIT	<
	CONI AT ERROR:	>
	MOVE	T1,WKBUFF+MDECNI	;GET ERROR CONI
	PUSHJ	P,.TXWDW		;IN HALF WORD
	TYPEIT	< = >
	TLNN	P4,10			;RH10?
	 MOVEI	T1,5			;NO
	TLNE	P4,10
	MOVEI 	T1,4			;YES
	MOVEM	T1,KONTYP
	MOVE	P1,WKBUFF+MDECNI
	TDNN	P1,KONMSK(T1)		;ANY ERROR BITS?
	 JRST	MDE015			;NO
	PUSHJ	P,CNIDCD		;YES GO TRANSLATE
	JRST	MDE016			;GO AROUND
MDE015:	TYPEIT	< NO ERROR BITS DETECTED>
MDE016:	TYPEIT	<
	CONI AT END:	>
	MOVE	T1,WKBUFF+MDECNF
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVE	P1,WKBUFF+MDECNF
	MOVE	T2,KONTYP
	TDNN	P1,KONMSK(T2)		;ANY ERRORS
	 JRST	MDE017		;NO
	PUSHJ	P,CNIDCD
	JRST	MDE020		;GO AROUND
MDE017:	TYPEIT	< NO ERROR BITS DETECTED>

	;HERE TO DUMP DATAI'S
MDE020:	TYPEIT	<
	DATAI >
	MOVE	P2,KONTYP		;GET CONTROLLER TYPE
	TRNE	P2,1			;RH10=4,RH20=5
	 MOVEI	P4,[ASCIZ/PTCR/]
	TRNN	P2,1
	 MOVEI	P4,[ASCIZ/RHCR/]
	MOVE	T1,P4
	PUSHJ	P,.TSTRG		;FINISH TYPING DATAI NAME
	TYPEIT	< AT ERROR:	>
	MOVE	T1,WKBUFF+MDEDTI
	PUSHJ	P,.TXWDW		;TYPE IN HALF WORD
	TYPEIT	<
	DATAI >
	MOVE	T1,P4			;WE SAVED IT BEFORE
	PUSHJ	P,.TSTRG
	TYPEIT	< AT END:	>
	MOVE	T1,WKBUFF+MDEDTF
	PUSHJ	P,.TXWDW
	TYPEIT	<
	DATAI >
	TRNE	P2,1			;WE SAVED THIS TOO
	 MOVEI	P4,[ASCIZ/PBAR/]	;FOR RH20
	TRNN	P2,1
	 MOVEI	P4,[ASCIZ/RHDB/]	;FOR RH10
	MOVE	T1,P4
	PUSHJ	P,.TSTRG
	TYPEIT	< AT ERROR:	>	;FINISH 
	MOVE	T1,WKBUFF+MDE2DT	;GET SECOND DATAI WORD
	PUSHJ	P,.TXWDW
	TYPEIT	<
	DATAI >
	MOVE	T1,P4			;GET REG NAME BACK
	PUSHJ	P,.TSTRG	
	TYPEIT	< AT END:	>
	MOVE	T1,WKBUFF+MDE2DF
	PUSHJ	P,.TXWDW
;SETUP AND CALL ROUTINES TO DUMP 16 DEVICE REGISTERS

;	HRRZ	T1,WKBUFF+MDECNI	;GET CONI EDIT 135
;	MOVEI	T2,4			;OFFSET FOR RH10
;	TDNN	T1,KONMSK(T2)		;IF NO ERROR BITS DON'T LIST 
;	SKIPE	S		;IF NON-ZERO-NO MORE LISTINGS
;	 POPJ	P,0			;DON'T LIST DEVICE REGS.
;	TLNN	F,F.DET			;EDIT 116-DID USER SAY /DETAIL?
;	 PJRST	TAPL11			;NO-DON'T DO ANY MORE.
	TYPEIT	<
DEVICE REGISTER INFORMATION:
		AT ERROR	AT END		DIFF.		TEXT
>
	MOVE	P1,[XWD 1,20]		;SETUP P1 FOR MODE 1 AND 20 ITEMS
	HRLZI	P2,MASREG			;STARTING ADDR OF TABLE
						;OF SIXBIT REG NAMES
	MOVE	T1,MDEDTP			;GET DEVICE TYPE
	HRR	P2,MSCNTL(T1)		;SETUP P2
	MOVE	P3,[XWD MDEDCR,MDEDCR]	;WHERE TO FIND WORDS.
	PUSHJ	P,HWDUMP			;IF ALL GOES WELL
	PUSHJ	P,TITLST	;EDIT 116 START ON NEXT PAGE
	POPJ	P,0		;WE'RE DONE!
	;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)/
	SIXBIT/SR(01)/
	SIXBIT/ER(02)/
	SIXBIT/MR(03)/
	SIXBIT/AS(04)/
	SIXBIT/DA(05)/
	SIXBIT/DT(06)/
	SIXBIT/LA(07)/
	SIXBIT/SN(10)/
	SIXBIT/OF(11)/
	SIXBIT/DC(12)/
	SIXBIT/CC(13)/
	SIXBIT/E2(14)/
	SIXBIT/E3(15)/
	SIXBIT/EP(16)/
	SIXBIT/PL(17)/

	;NOW THE CONTROL TABLE ADDRESSES

MSCNTL:	XWD	0,RS04CT
	XWD	0,TU16CT
	XWD	0,RP04CT
	XWD	0,RP05CT
	XWD	0,RP05CT

	;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)/



	;TAPlst--routine to list code 21 entries.
	;	called with TAPtry in p2.

TAPlst:	HLRZ	P1,P2
	ANDI	P1,70	;GET CONTROLLER TYPE
	LSH	P1,-3	;MOVED OVER
	TLNE	P2,(1B11)	;[415]IS CONTROLLER AN RH20?
	 AOS	P1		;YES ADD ONE TO TYPE 4=RH10,5=RH20
	MOVEM	P1,TAPKON	;SAVE IT
	CAIGE	P1,3	;DX10OR TM02?
	 JRST	TAPL01	;NO-NO UNIT TYPE OR S/N
	CAIE	P1,3	;DX10?
	 JRST	TAPLSA	;TM02
	typeit	<
	UNIT TYPE:	>
	HRRZ	P2,WKBUFF+TAPIEP
	SUB	P2,HEADWC
	ADDI	P2,WKBUFF		;OFFSET TO ERROR BLOCK
	MOVE	P1,XS.S4(P2)		;SENSE BYTES 4-7
	MOVEI	T1,[ASCIZ/TU70/]
	LDB	P3,[POINT 4,P1,23]	;GET TU MODEL
	CAIN	P3,14			;TU72-E?
	 MOVEI	T1,[ASCIZ/TU72-E/]	;YES
	PUSHJ	P,.TSTRG
;NOW CHECK FOR S/N
	CAIE	P3,14			;TU72?
	 JRST	TAPL01			;NOPE
	TYPEIT	<
	UNIT SERIAL #:	>
	MOVE	P3,XS.S12(P2)		;GET HI UNIT S/N
	LDB	T2,[POINT ^D8,P3,31]
	MOVEI	P1,0
	DPB	T1,[POINT ^D8,P1,23]
	MOVE	P3,XS.S16(P2)		;GET LO UNIT S/N
	LDB	T1,[POINT ^D8,P3,7]
	DPB	T2,[POINT ^D8,T1,27]	;MOVE IN HIGH ORDER
	PUSHJ	P,.ODECW
	JRST	TAPL01			;NOW CONTINUE

	;HERE DUMP UNIT TYPE AND SERIAL NUMBER FOR TU16&TU45
TAPLSA:	HRRZ	P2,WKBUFF+TAPIEP	;GET POINTER TO AT ERROR BLOCK
	SUB	P2,HEADWC	;WORDS IN HEADER
	ADDI	P2,WKBUFF	;P2 IS A GOODINDEXPOINTER
	TYPEIT	<
	UNIT TYPE:	>
	HRRZ	T2,T2.DDT(P2)	;GET UNIT TYPE REG
	ANDI	T2,77		;STRIP OF UNNEEDED BITS
	MOVE	T1,[SIXBIT/TU16/]	;ASSUME TU16
	CAIN	T2,12	;BUT CHECK
	MOVE	T1,[SIXBIT/TU45/]
	PUSHJ	P,.TSIXN	;LIST EITHER
	TYPEIT	<
	UNIT SERIAL #:	>
	HRRZ	P1,T2.DSN(P2)	;GET UNIT SERIAL NUMBER
	HRRZ	T1,P1
	ANDI	T1,170000
	LSH	T1,-14		;MSD MOVED DOWN
	PUSHJ	P,.TDECW	;IN DECIMAL
	HRRZ	T1,P1
	ANDI	T1,7400
	LSH	T1,-10		;NEXT DIGIT MOVED DOWN
	PUSHJ	P,.TDECW
	HRRZ	T1,P1
	ANDI	T1,360
	LSH	T1,-4
	PUSHJ	P,.TDECW
	HRRZ	T1,P1
	ANDI	T1,17
	PUSHJ	P,.TDECW	;NOW DO LSD
	TYPEIT	<.>
	JRST	TAPL01	;THEN CONTINUE

TAPl01:	typeit	<
	MEDIA	ID:	>
	move	t1,wkbuff+TAPrid	;get reelid
	pushj	p,.tsixn
	typeit	<
	LOCATION
	 OF FAILURE:	RECORD:  >
	move	t1,WKBUFF+TAPrec
	pushj	p,.odecw
	typeit	<  OF FILE:  >
	move	t1,wkbuff+TAPfil
	ADDi	t1,1		;correct again
	pushj	p,.odecw
	TYPEIT	<
	POSITION
	BEFORE ERROR:   RECORD:  >
	HRRZ	T1,WKBUFF+TAPPBE	;# RECORDS
	PUSHJ	P,.ODECW
	TYPEIT	<  OF FILE:  >
	HLRZ	T1,WKBUFF+TAPPBE	;# FILES
	ADDI		T1,1		;CORRECT TO GET CURRENT FILE
	PUSHJ	P,.ODECW
	TYPEIT	<
	CHAR. INTO RECORD:  >
	MOVE	T1,WKBUFF+TAPCCR
	PUSHJ	P,.ODECW


	;here we decode last transfer command

	typeit	<
	OPERATION:	>
	MOVE	T1,TAPKON	;GET CONTROLLER
	CAIN	T1,2		;TC10?
	 JRST	TC1CMD		;YUP
	CAIE	T1,5		;TM02 ON R20?
	CAIN	T1,4		;TM02?
	 JRST	TM2CMD		;DECODE TM02 COMMAND,ETC
	CAIE	T1,3		;DX10?
	 JRST	TM1CMD		;MUST BE TM10
	HRRZ	P2,WKBUFF+TAPIEP	;GET ERROR POINTER
	SUB	P2,HEADWC
	ADDI	P2,WKBUFF		;POINTER TO DX TERMINATION AREA
	move	p1,XS.CM1(P2)	;check last first
	tlne	p1,1b18			;bit 0=0?
	 jrst	TAPl02			;no try next
	tlnn	p1,1b19			;ok now bit 1
	 jrst	TAPl02			;nope
	jrst	TAPl06			;found it!!
TAPl02:	move	p1,XS.CMD(P2)
	tlne	p1,1b18
	 jrst	TAPl05
	tlnn	p1,1b19
	 jrst	TAPl05
	jrst	TAPl06
;unknown command
TAPl05:	typeit	<UNKNOWN,>
	jrst	TAPl07		;go around

;here when last cmd found, cmd in p1

TAPl06:	tlne	p1,1b20		;ignore length?
	 pushj	p,TAPlx1
	tlne	p1,1b21		;stat inh?
	 pushj	p,TAPlx2
	tlne	p1,1b22		;immediate
	 pushj	p,TAPlx3
	hlrz	t1,p1
	andi	t1,140000	;get data mode bits
	lsh	t1,-^d14	;moved over
	move	t1,TAPlx4(t1)	;asciz addr
	pushj	p,.tstrg
	TYPEIT	<  DEV.CMD.:   >	
	MOVEI	T2,[ASCIZ/ILLEGAL/]	;SET FOR DEFAULT
	move	t4,p1
	and	t4,[3770000]	;get device cmd
	lsh	t4,-^d12	;moved a bit
	skipn	t4
	 movei	t2,[asciz/TEST IO/]
	MOVE	T1,T4
	ANDI	T1,7		;SAVE ONLY LSD
	CAIE	T1,3		;END IN 3?
	 JRST	TAPL6A		;NO-GO AROUND
	MOVEI	T2,[ASCIZ/7 TRK MODE SET/]
	CAIL	T4,300	;T4<300?
	 MOVEI	T2,[ASCIZ/9TRK MODE SET/]	;T4 IS > 300
	CAIN	T4,03
	 movei	t2,[aSciz/NO OP/]
	cain	t4,13
	 movei	t2,[asciz/SET DIAG./]

;HERE START LOOKING FOR VALID COMMAND
;IF ALL COMPARES FAIL "ILLEGAL IS PRINTED
TAPL6A:	cain	t4,01
	 movei	t2,[asciz/WRITE/]
	cain	t4,02
	 movei	t2,[asciz/READ/]
	cain	t4,04
	 movei	t2,[asciz/SENSE/]
	cain	t4,33
	 movei	t2,[asciz/REQ.TRK.IN ERR/]
	cain	t4,14
	 movei	t2,[asciz/READ BACKWARD/]
	cain	t4,213
	 movei	t2,[asciz/LOOP WRITE TO READ/]
	cain	t4,324
	 movei	t2,[asciz/SENSE RELEASE/]
	cain	t4,364
	 movei	t2,[asciz/SENSE RESERVE/]
	cain	t4,07
	 movei	t2,[asciz/REWIND/]
	cain	t4,017
	 movei	t2,[asciz/UNLOAD/]
	cain	t4,27
	 movei	t2,[asciz/ERASE GAP/]
	cain	t4,37
	 movei	t2,[asciz/WRITE TAPE MARK/]
	cain	t4,47
	 movei	t2,[asciz/BACKSPACE BLOCK/]
	cain	t4,57
	 movei	t2,[asciz/BACKSPACE FILE/]
	cain	t4,67
	 movei	t2,[asciz/SPACE BLOCK/]
	cain	t4,77
	 movei	t2,[asciz/SPACE FILE/]
	cain	t4,227
	 movei	t2,[asciz/DATA SEC. ERASE/]
	move	t1,t2		;something is in t2
	pushj	p,.tstrg
	jrst	TAPl07		;to dump status

TAPlx1:	typeit	<ILE, >
	popj	p,0

TAPlx2:	typeit	<S.I., >
	popj	p,0

TAPlx3:	typeit	<IMM, >
	popj	p,0


TAPlx4:[asciz/CORE DUMP,/]
	[asciz/BYTE,/]
	[asciz/ASCII,/]
	[asciz/SIXBIT,/]



;	here talk about status etc

TAPl07:	typeit	<
	STATUS:  CU IS:  >
	hrrz	p4,wkbuff+TAPiep	;error pointer
	sub	p4,headwc
	addi	p4,wkbuff
	MOVEI	T1,[ASCIZ/TX01,/]
	MOVE	T2,XS.S8(P4)
	TLNE	T2,1B30			;TX01?
	 MOVEI	T1,[ASCIZ/TX02,/]
	PUSHJ	P,.TSTRG
	move	t3,xs.S12(p4)		;sense bytes 12-15 at error
	and	t3,[1400000000]		;c.u. features
	movss	,T3
	lsh		t3,-^d8
	setz	t1,
	cain	t3,00
	 movei	t1,[asciz/9TRK PE,/]
	cain	t3,01
	 movei	t1,[asciz/7TRK NRZI/]
	cain	t3,02
	 movei	t1,[asciz/9TRK NRZI/]
	cain	t3,03
	 movei	t1,[asciz/7 & 9 TRK NRZI/]
	pushj	p,.tstrg
	move	t3,xs.s0(p4)	;offset should still be it p4
	typeit	< DEVICE IS:   WRITE >
	move	t1,[sixbit/ENB/]
	tlne	t3,4		;better check
	 move	t1,[sixbit/LOCKED/]
	pushj	p,.tsixn
	MOVE	T1,XS.S8(P4)
	TLNN	T1,1B30		;TX02?
	 JRST	TAPL7A		;NO
	TYPEIT	<
	TX02 SERIAL #:	>
	MOVE	P3,XS.S12(P4)	;GET HI ORDER SN
	MOVEI	P1,0
	LDB	T1,[POINT ^D14,P3,23]
	PUSHJ	P,.ODECW

	;now for error

TAPL7A:	TYPEIT	<
	ERROR:	>
	MOVEI	T1,[ASCIZ/NON-RECOVERABLE /]
	move	t2,wkbuff+TAPtry
	tlnn	t2,errhrd	;hard or soft?
	 movei	t1,[asciz/RECOVERABLE /]
	pushj	p,.tstrg
	movei	t1,6		;setup for dx10
	movem	t1,kontyp	;store it
	hrrz	p3,wkbuff+TAPiep	;start
	sub	p3,headwc
	addi	p3,wkbuff
	move	p1,xs.cni(p3)	;get error coni
	pushj	p,cnidcd	;"one-for-one" x-lation
	TYPEIT	< IN DX10 CONI, >
	movei	t1,30		;offset for icpc+1
	movem	t1,kontyp	;store
	hrrz	p3,wkbuff+TAPiep	;start
	sub	p3,headwc
	addi	p3,wkbuff
	move	p1,xs.st1(p3)	; GET ICPC+1
	pushj	p,cnidcd
	TYPEIT	< IN ICPC+1 >
	TYPEIT	<
	***AS OF DX10 MICROCODE VERSION 4(0), RECOVERABLE ERRORS
	ARE NOT REPORTED TO MONITOR IF DX10 MICROCODE ERROR
	RETRY IS ENABLED.***
>

	hrrz	p3,wkbuff+TAPiep	;start
	sub	p3,headwc
	addi	p3,wkbuff
	move	p1,xs.st1(p3)
	tlnn	p1,1b30		;seq error?
	 jrst	TAPl7B		;nope
	ANDI	p1,37400	;error code
	lsh	p1,-10
	typeit	<
		SEQ CODE:  >
	move	t1,seqmes(p1)
	pushj	p,.tstrg
TAPL7B:	MOVE	P1,XS.CNI(P3)	;GET CONI AT ERROR
	TRNE	P1,1B26		;MP ERROR?
	TLNE	P1,1B35		;MP RUNNING?
	 JRST	TAPL10			;NOPE
	TYPEIT	<
		DIAG. FAILURE CODE:	>
	HRRZ	T2,XS.DAG(P3)		;GET INDEX
	ANDI	T2,77			;-100
	MOVE	T1,DXDMES(T2)		;GET PNTR
	PUSHJ	P,.TSTRG		;LIST THE MESSAGE

;now for retrys

TAPL10:
	TYPEIT	<
	RETRY COUNT:	>
	hrrz	t1,wkbuff+TAPtry
	pushj	p,.ODECW	
	TYPEIT	<  -->
	HRRZ	T1,WKBUFF+TAPFES	;FINAL ERROR STATUS
	MOVE	T1,TRYMES(T1)		;GET ASCIZ ADDR
	PUSHJ	P,.TSTRG
	TYPEIT	<-->
	TLNN	F,F.DET		;DID USER SAY /DETAIL?
	 jrst 	TAPl11		;nope
	TYPEIT	<
 CONTROLLER INFORMATION:>
	TYPEIT	<
	CONTROLLER:	>
	MOVE	T1,TAPKON	;GET CONTROLLER
	CAIN	T1,2		;TC10?
	 JRST	TC1CON		;YUP
	CAIE	T1,5		;TM02 ON R20?
	CAIN	T1,4	;TM02?
	 JRST	TM2CON	;GO DUMP TM02 REGISTERS ETC
	CAIE	T1,3		;DX10?
	 JRST	TM1CON		;MUST BE TM10
	move	p1,wkbuff+TAPtry
	hlrz	t1,p1
	andi	t1,70	;get controller
	typeit	<DX10 #>	;modify if more than only dx10*****
	hlrz	t1,p1
	andi	t1,7	;controller #
	pushj	p,.toctw
	typeit	<
	CONI AT ERROR:	>
	movei	t1,6		;dx10
	movem	t1,kontyp
	hrrz	p3,wkbuff+TAPiep
	sub	p3,headwc
	addi	p3,wkbuff
	move	p1,xs.cni(p3)	;coni at error
	move	t1,p1
	pushj	p,.TXWDW
	TYPEIT	< = >
	pushj	p,cnidcd
	typeit	<
	CONI AT END:	>
	hrrz	p3,wkbuff+TAPfep
	sub	p3,headwc
	addi	p3,wkbuff
	move	p1,xs.cni(p3)
	move	t1,p1
	pushj	p,.TXWDW
	TYPEIT	< = >
	pushj	p,cnidcd
	TYPEIT	<
	ICPC+1 AT ERROR:	>
	hrrz	p3,wkbuff+TAPIEP
	sub	p3,headwc
	addi	p3,wkbuff
	PUSH	P,P3		;SAVE THE PNTR
	MOVE	P1,XS.ST1(P3)	;GET THE WORD AT ERROR
	MOVE	T1,P1
	PUSHJ	P,.TXWDW	;OCTAL HALF WORDS
	TYPEIT	< = >
	MOVEI	T1,30		;OFFSET
	MOVEM	T1,KONTYP	;STORED
	PUSHJ	P,CNIDCD
	TYPEIT	<
	ICPC+1 AT END:	>
	hrrz	p3,wkbuff+TAPFEP
	sub	p3,headwc
	addi	p3,wkbuff
	PUSH	P,P3		;SAVE THE PNTR
	MOVE	P1,XS.ST1(P3)	;GET THE WORD AT END
	MOVE	T1,P1
	PUSHJ	P,.TXWDW	;OCTAL HALF WORDS
	TYPEIT	< = >
	MOVEI	T1,30		;OFFSET
	MOVEM	T1,KONTYP	;STORED
	PUSHJ	P,CNIDCD
	POP	P,P2		;PNTR AT END
	POP	P,P3		;PNTR AT ERROR
	TYPEIT	<
	ICPC+2 AT ERROR:	>
	MOVE	T1,XS.ST2(P3)	;ICPC+2 AT ERROR
	PUSHJ	P,.TXWDW
	TYPEIT	<
	ICPC+2 AT END:		>
	MOVE	T1,XS.ST2(P2)	;ICPC+2 AT END
	PUSHJ	P,.TXWDW
	MOVE	T1,XS.CNI(P3)	;CONI AT ERROR
	TRNN	T1,1B27			;MEM PAR?
	 JRST	TAPL12			;NO
	TYPEIT	<
	DATA SEEN BY DX10 AT PARITY ERROR:	>
	MOVE	T1,XS.MR1(P3)		;DX REG 10&11
	PUSHJ	P,.TXWDW
	jrst	TAPl12

TAPl11:	typeit	<
=====REST OF INFORMATION AVAILABLE BY USING /DETAIL: SWITCH=====>
	POPJ	P,0	;GO BACK NOW

	;HERE DECODE TC10 OPERATION

TC1CMD:	MOVE	T1,WKBUFF+TAPIEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T2,TC.CNI(T1)	;GET CONI MTC
	PUSH	P,T2		;SAVE IT
	ANDI	T2,76000	;FUNCTION CODE
	LSH	T2,-12
	MOVE 	T1,TC1MES(T2)
	PUSHJ	P,.TSTRG
	TYPEIT	<
	STATUS:  >
	POP	P,P1		;GET CONI BACK
	TLNN	P1,1B21		;WRITE LOCKED
	 JRST	TC1CM1
	TYPEIT	<WRITE-LOCKED, >
TC1CM1:	TRNN	P1,1B26
	 JRST	TC1CM2
	TYPEIT	<CORE DUMP, >
TC1CM2:	TRNN	P1,1B29
	 JRST	TC1CM3
	TYPEIT	<NRZI,>

	;NOW TO DO ERROR
TC1CM3:	TYPEIT	<
	ERROR:  >
	MOVE	T2,WKBUFF+TAPTRY
	MOVEI	T1,[ASCIZ/NON-RECOVERABLE /]
	TLNN	T2,ERRHRD	;HARD OR SOFT?
	MOVEI	T1,[ASCIZ/RECOVERABLE /]
	PUSHJ	P,.TSTRG
	HLRZ	T2,P1
	ANDI	T2,14
	SKIPN	T2
	 JRST TC1CM4	;NOTHING THERE
	CAIN	T2,14
	 MOVEI	T1,[ASCIZ/NXM /]
	CAIN	T2,4
	 MOVEI	T1,[ASCIZ/MEM DATA PARITY ERR /]
	CAIN	T2,10
	 MOVEI	T1,[ASCIZ/CTL WD PARITY ERR /]
	PUSHJ	P,.TSTRG
TC1CM4:	MOVEI	T1,7
	MOVEM	T1,KONTYP	;SET FOR TC10
	PUSHJ	P,CNIDCD	;P1 STILL VALID
	JRST	TAPL10		;NOW GO TO RETRY

	;HERE DECODE TM10 OPERATION:

TM1CMD:	MOVE	T1,WKBUFF+TAPIEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	PUSH	P,T1	;SAVE THAT OFFSET
	MOVE	T2,TM.CNC(T1)	;CONI MTC
	PUSH	P,T2	;SAVE IT ALSO
	ANDI	T2,FUNMSK
	LSH	T2,-FUNSFT
	MOVE	T1,FUNMSG(T2)
	PUSHJ	P,.TSTRG
	TYPEIT	<
	STATUS: >
	POP	P,P1	;GET CONI MTC BACK
	MOVE	T3,P1
	ANDI	T3,DENMSK
	LSH	T3,-DENSFT
	MOVE	T1,DENMSG(T3)
	PUSHJ	P,.TSTRG	;PUBLISH DENSITY
	TRNN	P1,PARTYP
	 JRST	TM1CM1
	TYPEIT	< ODD PARITY,>
	 JRST	TM1CM2
TM1CM1:	TYPEIT	< EVEN PARITY,>
TM1CM2:	TRNN	P1,CORDMP
	JRST	TM1CM3
	TYPEIT	<CORE DUMP,>
TM1CM3:	POP	P,T1	;GET INDX BACK
	MOVE	P1,TM.CNS(T1)	;CONI MTS
	TRNN	P1,STRK
	 JRST	TM1CM4
	TYPEIT	< 7 TRACK,>
	JRST	TM1CM5
TM1CM4:	TYPEIT	< 9 TRACK,>
TM1CM5:	TRNN	P1,WLOCK
	JRST	TM1CM6
	TYPEIT	< WRITE LOCKED
>
	JRST	TM1CM7
TM1CM6:	TYPEIT	< WRITE ENABLED
>

TM1CM7:	TYPEIT	<
	ERROR:  >
	MOVE	T2,WKBUFF+TAPTRY
	MOVEI	T1,[ASCIZ/NON-RECOVERABLE /]
	TLNN	T2,ERRHRD
	 MOVEI	T1,[ASCIZ/RECOVERABLE /]
	PUSHJ	P,.TSTRG
	MOVEI	T1,3	;SET FOR TM10
	MOVEM	T1,KONTYP
	MOVE	T1,WKBUFF+TAPIEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	P1,TM.CNS(T1)	;ERROR CONI MTS
	HLRZ	T2,WKBUFF+TAPTRY	;GET CONTROLLER TYPE
	TRNN	T2,1B32			;TM10A?
	 TDZ	P1,[7B13!1B27!1B31]	;CLR TM10B ONLY BITS
	PUSHJ	P,CNIDCD
	JRST	TAPL10		;GO DO RETRYS

	;HERE LIST LAST COMMAND TO TM02 AND ERROR DETECTED
TM2CMD:	TYPEIT	<
	OPERATION AT ERROR:	>
	HRRZ	P3,WKBUFF+TAPIEP	;GET POINTER TO ERRR BLOCK
	SUB	P3,HEADWC
	ADDI	P3,WKBUFF		;INDEX VALUE BUILT INTO P3
	PUSH	P,P3		;SAVE IT
	HRLZ	T1,T2.ICR(P3)	;LAST COMMAND
	MOVEI	T2,1		;FINISH SEUP WITH OFFSET TO TU16CR
	PUSHJ	P,@MDE011(T2)	;USE CODE FROM ER.MDE
	POP	P,P3		;GET ERROR POINTER BACK
	;NOW LIST THE DETECTED ERROR
	TYPEIT	<
	ERROR:  >
	MOVE	T2,WKBUFF+TAPTRY
	MOVEI	T1,[ASCIZ/NON-RECOVERABLE /]
	TLNN	T2,ERRHRD
	 MOVEI	T1,[ASCIZ/RECOVERABLE /]
	PUSHJ	P,.TSTRG
	MOVE	T1,TAPKON	;GET CONTROLLER TYPE
	MOVEM	T1,KONTYP
	MOVE	P1,T2.CNI(P3)	;ERROR CONI 
	PUSHJ	P,CNIDCD
	JRST	TAPL10		;GO DO RETRYS

	;HERE DUMP CONIS & CONTROLLER TYPE FOR TC10

TC1CON:	TYPEIT	< TC10
	CONI AT ERROR: >
	MOVE	T1,WKBUFF+TAPIEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T1,TC.CNI(T1)	;CONI TC10
	MOVE	P1,T1	;SAVE IT FOR LATER
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI	T1,7
	MOVEM	T1,KONTYP	;SET FOR TC10
	PUSHJ	P,CNIDCD
	TYPEIT	<
	CONI AT END: >
	MOVE	T1,WKBUFF+TAPFEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T1,TC.CNI(T1)	;ENDING CONI TC10
	MOVE	P1,T1	;SAVE IT FOR LATER
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVE	T1,P1
	MOVE	T2,KONTYP
	AND	T1,KONMSK(T2)
	SKIPN	T1
	 JRST	TC1CO1	;NONE SET
	PUSHJ	P,CNIDCD	;GO TRANSLATE
	POPJ	P,0		;GO HOME

TC1CO1:	TYPEIT	<NO ERROR BITS DETECTED>
	POPJ	P,0	;GO HOME
;HERE TO DO CONTROLLER & CONIS FOR TM10

TM1CON:	TYPEIT	< TM10>
	HLRZ	T2,WKBUFF+TAPTRY	;GET TYPE
	MOVEI	T1,[ASCIZ/-A/]		;SET FOR TM10A
	TRNE	T2,1B32			;BUT IF
	 MOVEI	T1,[ASCIZ/-B/]		;CHANGE TO TM10B
	PUSHJ	P,.TSTRG		;NOW SAY EITHER
	TYPEIT	<
	CONI AT ERROR: >
	MOVE	T1,WKBUFF+TAPIEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T1,TM.CNS(T1)	;CONI ERROR MTS
	HLRZ	T2,WKBUFF+TAPTRY	;GET CONTROLLER TYPE
	TRNN	T2,1B32			;TM10A?
	 TDZ	T1,[7B13!1B27!1B31]	;CLR TM10B ONLY BITS
	MOVE	P1,T1		;SAVE IT
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI 	T1,3	;SET FOR TM10
	PUSHJ	P,CNIDCD	;P1 STILL VALID
	TYPEIT	<
	CONI AT END: >
	MOVE	T1,WKBUFF+TAPFEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T1,TM.CNS(T1)	;FINAL CONI MTS
	HLRZ	T2,WKBUFF+TAPTRY	;GET CONTROLLER TYPE
	TRNN	T2,1B32			;TM10A?
	 TDZ	T1,[7B13!1B27!1B31]	;CLR TM10B ONLY BITS
	MOVE	P1,T1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVE	T2,KONTYP
	AND	T1,KONMSK(T2)	;GET ERROR BITS
	SKIPN	T1		;ANY SET?
	 JRST	TM1CO1		;NOPE
	PUSHJ	P,CNIDCD	;GO DECODE
	POPJ	P,0		;GO HOME

TM1CO1:	TYPEIT	< NO ERROR BITS DETECTED>
	POPJ	P,0	;GO HOME
	;HERE LIST CONI'S,DATAI'S AND DEVICE REGISTERS FOR TM02
	;DETAIL SWITCH HAS ALREADY BEEN CHECKED
TM2CON:	TYPEIT	<  TM02>
	TYPEIT	<
	CONI AT ERROR:	>
	MOVE	P4,WKBUFF+TAPFEP	;GET FINAL POINTER
	SUB	P4,HEADWC
	ADDI	P4,WKBUFF	;FINAL POINTER IN P4
	PUSH	P,P4		;SAVE FOR LATER
	HRRZ	P3,WKBUFF+TAPIEP	;DI ERROR POINTER
	SUB	P3,HEADWC
	ADDI	P3,WKBUFF
	PUSH	P,P3	;FOR LATER
	MOVE	T1,T2.CNI(P3)	;CONI AT ERROR
	MOVE	P1,T1		;SAVE IT FOR CNIDCD
	PUSHJ	P,.TXWDW		;IN HALF WORD
	TYPEIT	< = >
	MOVE	T1,TAPKON	;GET CONTROLLER TYPE
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD		; GO TRANSLATE
	TYPEIT	<
	CONI AT END:	>
	MOVE	T1,T2.CNI(P4)	;GET CONI AT END
	MOVE	P1,T1		;SAVEIT
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	PUSHJ	P,CNIDCD

	;HERE TO DUMP DATAI'S
	TYPEIT	<
	DATAI >
	MOVE	P2,KONTYP		;GET CONTROLLER TYPE
	TRNE	P2,1			;RH10=4,RH20=5
	 MOVEI	P1,[ASCIZ/PBAR/]
	TRNN	P2,1
	 MOVEI	P1,[ASCIZ/RHCR/]
	MOVE	T1,P1
	PUSHJ	P,.TSTRG		;FINISH TYPING DATAI NAME
	TYPEIT	< AT ERROR:	>
	MOVE	T1,T2.DTI(P3)	;DATAI AT ERROR
	PUSHJ	P,.TXWDW		;TYPE IN HALF WORD
	TYPEIT	<
	DATAI >
	MOVE	T1,P1			;WE SAVED IT BEFORE
	PUSHJ	P,.TSTRG
	TYPEIT	< AT END:	>
	MOVE	T1,T2.DTI(P4)	;VALUE AT END
	PUSHJ	P,.TXWDW
	TYPEIT	<
	DATAI >
	TRNE	P2,1			;WE SAVED THIS TOO
	 MOVEI	P1,[ASCIZ/PTCR/]	;FOR RH20
	TRNN	P2,1
	 MOVEI	P1,[ASCIZ/RHDB/]	;FOR RH10
	MOVE	T1,P1
	PUSHJ	P,.TSTRG
	TYPEIT	< AT ERROR:	>	;FINISH 
	MOVE	T1,T2.2DT(P3)		;GET SECOND DATAI WORD
	PUSHJ	P,.TXWDW
	TYPEIT	<
	DATAI >
	MOVE	T1,P1			;GET REG NAME BACK
	PUSHJ	P,.TSTRG	
	TYPEIT	< AT END:	>
	MOVE	T1,T2.2DT(P4)	;VALUE AT END
	PUSHJ	P,.TXWDW
;SETUP AND CALL ROUTINES TO DUMP 16 DEVICE REGISTERS
;FIRST WE MUST PUT BOTH AT ERROR AND AT END VALUES INTO ONE LOCATION
	POP	P,P3	;GET P3 BACK
	POP	P,P4		;P4 TOO
	HRLZI	T1,-12		;# TO MOVE
	ADDI	P3,T2.DCR	;UPDATE AT ERROR POINTER TO FIRST
	ADDI	P4,T2.DCR	;AT END POINTER TOO
TM2CN1:	HRRZ	T2,(P4)	;NEXT AT END WORD TO T2
	HRLM	T2,(P3)	;MOVED  TO AT EROR LOCATION
	AOS	P3
	AOS	P4
	AOBJN	T1,TM2CN1	;GET NEXT PAIR OR...
	TYPEIT	<
DEVICE REGISTER INFORMATION:
		AT ERROR	AT END		DIFF.		TEXT
>
	MOVE	P1,[XWD 1,12]		;SETUP P1 FOR MODE 1 AND 12 ITEMS
	HRLZI	P2,TU6REG			;STARTING ADDR OF TABLE
						;OF SIXBIT REG NAMES
	MOVEI	T1,1			;GET DEVICE TYPE
	HRR	P2,MSCNTL(T1)		;SETUP P2
	HRRZ	T1,WKBUFF+TAPIEP
	SUB	T1,HEADWC
	ADDI	T1,T2.DCR	;WHERE TO FIND AT ERROR WORDS
	HRLZ	P3,T1		;SET UP LEFT HALF
	HRR	P3,T1		;AT END LOCATION TO RIGHT HALF
	PUSHJ	P,HWDUMP			;IF ALL GOES WELL
	PUSHJ	P,TITLST	;EDIT 116 START ON NEXT PAGE
	POPJ	P,0		;WE'RE DONE!

	;TC10 FUNCTION CODES

TC1MES:	[ASCIZ/ CLEAR/]
	[ASCIZ/ REWIND/]
	[ASCIZ/ RD FWD RECORD/]
	[ASCIZ/ R-C FWD RECORD/]
	[ASCIZ/ WRITE FWD/]
	[ASCIZ/ WRITE FILE MARK/]
	[ASCIZ/ SPACE FWD RECORD/]
	[ASCIZ/ SPACE REV RECORD/]
	[ASCIZ/ SET JD WHEN UNIT READY/]
	[ASCIZ/ UNLOAD/]
	[ASCIZ/ RD FWD TO EOF/]
	[ASCIZ/ R-C FWD TO EOF/]
	[ASCIZ/ WRITE W. LONG GAP/]
	[ASCIZ/ ERASE GAP/]
	[ASCIZ/ SPACE FWD TO EOF/]
	[ASCIZ/ SPACE REV TO EOF/]
	[ASCIZ/ ILL/]
	[ASCIZ/ ILL/]
	[ASCIZ/ READ REV RECORD/]
	[ASCIZ/ R-C REV RECORD/]
	[ASCIZ/ ILL/]
	[ASCIZ/ ILL/]
	[ASCIZ/ ILL/]
	[ASCIZ/ ILL/]
	[ASCIZ/ ILL/]
	[ASCIZ/ ILL/]
	[ASCIZ/ READ REV TO EOF/]
	[ASCIZ/ R-C REV TO EOF/]
TAPl12:	typeit	<
       REGISTER	AT ERROR	AT END		DIFF		TEXT
>
	move	p1,[xwd 3,4]	;full word octal,4items
	move	p2,[xwd dx1reg,dx1ctl]	;table addresses
	hrrz	t1,wkbuff+TAPiep	;offset to error words
	sub	t1,headwc
	hrlz	p3,t1			;fixed up
	move	t1,wkbuff+TAPfep	;offset to end words
	sub	t1,headwc
	hrr	p3,t1			;finish setup
	pushj	p,hwdump		;takes a while
	HRRZ	T1,WKBUFF+TAPIEP
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T2,XS.MD(T1)	;FIND THE RIGHT WORD
	PUSH	P,T1		;SAVE INDEX
	PUSH	P,T2		;SAVE WHAT TO DUMP
	TYPEIT	<	
	CPMA&MD:	>
	POP	P,T1		;WHAT TO DUMP
	PUSHJ	P,.TXWDW	;IN HALF WORD
	TYPEIT	<
	DR:	>
	POP	P,T1		;RETURN INDEX
	MOVE	T1,XS.DR(T1)	;WHAT TO DUMP
	PUSHJ	P,.TXWDW	;AGAIN IN HALF WORD

TAP12A:	typeit	<
DEVICE INFORMATION:  *IN OCTAL BYTES*
     SENSE BYTE	AT ERROR	AT END		DIFF		TEXT
>
	move	p1,[xwd 4,6]	;full word 8 BIT BYTES,6 items
	move	p2,[xwd t70reg,t70ctl]	;table addresses
	move	t1,wkbuff+TAPiep
	sub	t1,headwc
	addi	t1,4		;adjust for those we just typed
	hrlz	p3,t1
	move	t1,wkbuff+TAPfep
	sub	t1,headwc
	addi	t1,4
	hrr	p3,t1
	pushj	p,hwdump

	typeit	<
CHAN CMD LIST:
	CPC:	>
	MOVE	P3,WKBUFF+TAPIEP
	SUB	P3,HEADWC
	ADDI	P3,WKBUFF
	MOVE	T1,XS.CPC(P3)
	PUSHJ	P,.TXWDW
	PUSHJ	P,.TCRLF
	TYPEIT	<	CMDS:	>
	move	t1,XS.CMD(P3)
	pushj	p,.tXWDw
	pushj	p,.tcrlf
	pushj	p,.ttabc
	PUSHJ	P,.TTABC	;SOME MORE SPACE
	move	t1,XS.CM1(P3)
	pushj	p,.tXWDw
	pushj	p,.tcrlf
	pushj	p,titlst	;start on next page
	popj	p,0		;return

;now some tables etc for tu70 reporting

seqmes:[asciz/0-CMD LST STR/]
	[ASCIZ/1-AI RUNAWAY/]
	[ASCIZ/2-BUS I IN PARITY/]
	[ASCIZ/3-GETSTS,ADR IN NOT SET/]
	[ASCIZ/4-GETSTS,ADRIN NOT RESET/]
	[ASCIZ/5-GETSTS,STATIN NOT SET/]
	[ASCIZ/6-GETSTS,STATIN NOT RESET/]
	[ASCIZ/7-GETSTS,OPRIN NOT RESET/]
	[ASCIZ/10-MEMRD,8R NOT READY/]
	[ASCIZ/11-MEMWR,8R NOT READY/]
	[ASCIZ/12-STPDEV,STATUS NOT SET/]
	[ASCIZ/13-SETSTP,STATUS NOT SET/]
	[ASCIZ/14-CMDST,SHORT BUSY ERROR/]
	[ASCIZ/15-CMDST,NO OPRIN OR SELIN/]
	[ASCIZ/16-CMDST,ADRIN NOT SET/]
	[ASCIZ/17-CMDST,ADRIN NOT RESET/]
	[ASCIZ/20-CMDST,STATUS NOT SET/]
	[ASCIZ/21-CMDST,STATUS NOT RESET/]
	[ASCIZ/22-CMDST,OPRIN NOT RESET/]
	[ASCIZ/23-CMDERR,OPRIN NOT RESET/]
	[ASCIZ/24-RDSEN,RSB NOT COMPLETE/]
	[ASCIZ/25-SILO NOT READY/]
	[ASCIZ/26-XFER NOT FOLLOW R-W CMD/]
	[ASCIZ/27-XFER CMD NOT WITHIN 10 WDS/]
	[ASCIZ/30-CMDBSY,STATUS NOT RESET/]
	[ASCIZ/31-STATUS DIDN'T PROPAGATE THRU SILO/]
	[ASCIZ/32-TMCHK2-BYTE AVAIL DIDNT RESET/]
	[ASCIZ/33-CMDST-TX01 ERROR/]
	[ASCIZ/34-WAIT-TX01 ERROR/]
	[ASCIZ/35-SILO NOT READY READING S.B./]
	[ASCIZ/36-RDSEN-NOT ALL BYTES/]
	[ASCIZ/37-TX01 ADR NOT COMPARE/]
	[ASCIZ/40-SPUR BLK DONE INT/]
	[ASCIZ/41-NO DEV ACTIVE/]
	[ASCIZ/42-ILLEGAL/]
	[ASCIZ/43-RDSEN-INIT. SEL. ERROR/]
	;HERE ARE THE FAILURE MESSAGES FOR THE DX10 MICROCODE
	;DIAGNOSTICS PERFORMED IN THE IDLE LOOP.

DXDMES:	[ASCIZ/100-LBO NOT CLR AC/]
	[ASCIZ/101-STM NOT CLR AC/]
	[ASCIZ/102-INT NOT CLR AC/]
	[ASCIZ/103-L8S NOT CLR AC/]
	[ASCIZ/104-LCB NOT CLR AC/]
	[ASCIZ/105-L8C NOT CLR AC/]
	[ASCIZ/106-L8B NOT CLR AC/]
	[ASCIZ/107-L8A NOT CLR AC/]
	[ASCIZ/110-8R BYTE A BAD/]
	[ASCIZ/111-8R BYTE B BAD/]
	[ASCIZ/112-8R BYTE C BAD/]
	[ASCIZ/113-8R2 SEL BAD/]
	[ASCIZ/114-8R1 SEL BAD/]
	[ASCIZ/115-8R0 SEL BAD/]
	[ASCIZ/116-WRAP SEL 8R3 BAD/]
	[ASCIZ/117-WRAP SEL 8R0 BAD/]
	[ASCIZ/120-INT NOT SEL 8R0/]
	[ASCIZ/121-SILO FAIL-DUMP/]
	[ASCIZ/122-SILO FAIL-DUMP-SLOW-CLOCK/]
	[ASCIZ/123-SILO FAIL-BYTE/]
	[ASCIZ/124-SILO FAIL-BYTE-SLOW-CLOCK/]
	[ASCIZ/125-SILO FAIL-ASCIZ/]
	[ASCIZ/126-SILO FAIL-ASCIZ-SLOW-CLOCK/]
	[ASCIZ/127-SILO FAIL-SIXBIT/]
	[ASCIZ/130-SILO FAIL-SIXBIT-SLOW-CLOCK/]
	[ASCIZ/131-TBD NOT SKIP/]
	[ASCIZ/132-NO INT ON OVERFLOW/]
	[ASCIZ/133-RESET OVERFLOW-INT DIDNT CLR/]
	[ASCIZ/134-CPC DATA TEST FAIL/]
	[ASCIZ/135-DAC DATA TEST FAIL/]
	[ASCIZ/136-C.U.-NO RESPONSE TO SEL SEQ/]
	[ASCIZ/137-C.U.-NO RESPONSE TO DEV ADDR 0/]
	[ASCIZ/140-ADDR IN-NO SET IN SEL SEQ/]
	[ASCIZ/141-PAR ERR IN BUS-ADDR PRESENTED/]
	[ASCIZ/142-ADDR NOT 0-SEL UNIT 0/]
	[ASCIZ/143-ADDR IN-NO DROP DURING SEL SEQ/]
	[ASCIZ/144-STATUS IN-NO SET DURING SEL SEQ/]
	[ASCIZ/145-PAR ERR ON BUS W STATUS BYTE/]
	[ASCIZ/146-NON 0 INIT STATUS BYTE/]
	[ASCIZ/147-STATUS IN-NO DROP W SERVICE OUT SET/]
	[ASCIZ/150-SRV IN NO SET/]
	[ASCIZ/151-PAR ERR ON BUS W SENSE BYTE/]
	[ASCIZ/152-SERVICE IN-NO DROP W SRV OUT/]
	[ASCIZ/153-STATUS IN-NO SET AFTER 24 BYTES/]
	[ASCIZ/154-PAR ERR IN STATUS BYTE AFTER SENSE/]
	[ASCIZ/155-STATUS IN-NO DROP AFTER ENDING STATUS/]
	[ASCIZ/156-OPER IN -NO DROP AFTER SENSE/]
	[ASCIZ/157-REQ IN NO SET AFTER SHORT BUSY SEQ/]
	[ASCIZ/160-ADDR IN NO SET AFTER CU INIT.SEQ/]
	[ASCIZ/161-PAR ERROR ON BUS W CU INIT SEQ/]
	[ASCIZ/162-NOT 0 ADDR W CU INIT SEQ/]
	[ASCIZ/163-ADDR IN NO DROP W CU INIT SEQ/]
	[ASCIZ/164-STATUS IN NO SET W CU INIT SEQ/]
	[ASCIZ/165-STATUS IN NO DROP W CU INIT SEQ/]
	[ASCIZ/166-OPR IN NO DROP W CU INIT SEQ/]
	[ASCIZ/167-SRV OUT NO SET W TESTS 13-23/]
	[ASCIZ/170-SRV OUT NO CLR W TESTS 13-23/]
DX1REG:	SIXBIT/ B CNT/
	SIXBIT/TAGBUS/
	SIXBIT/   DAC/
	SIXBIT/STATUS/

T70REG:	SIXBIT/   0-3/
	SIXBIT/   4-7/
	SIXBIT/  8-11/
	SIXBIT/ 12-15/
	SIXBIT/ 16-19/
	SIXBIT/ 20-23/

DX1CTL:	XWD	-1,NOTRAN
	XWD	31,DXTAGB	;DX10 TAGS & BUS
	XWD	-1,NOTRAN
	XWD	-1,DX1FEA

T70CTL:	XWD	-1,T7SB0S	;TU70 SENSE BYTES 0-3
	XWD	-1,DXSB4S	;TU70 SENSE BYTES 4-7
	XWD	36,SB81DV
	RPMRDV
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN

	;TAPSER STATE CODES FOR ERROR RECOVERY

TRYMES:	0
	[ASCIZ/REPOSITION  TERM./]
	[ASCIZ/RETRY TERM./]
	[ASCIZ/ERASE GAP TERM./]
	[ASCIZ/TAPE CLEANER SEQ. BACKSPACE/]
	[ASCIZ/TAPE CLEANER SEQ. FOWARD/]

;NOW SOME ROUTINES FOR SPECIAL TRANSLATIONS

DX1FEA:	TYPEIT	<  ECO: >
	PUSH	P,P1		;SAVE INDEX
	LDB	P1,[POINT 7,P2,26]
	LSH	P1,4		;LEFT JUSTIFY
	PUSHJ	P,TYPBCD
	TYPEIT	<  DX10 S/N: >
	LDB	P1,[POINT 9,P2,35]
	LSH	P1,4
	PUSHJ	P,TYPBCD
	LDB	T1,[POINT 2,P2,5]
	MOVE	T1,DXMES(T1)	;FUNCTION
	PUSHJ	P,.TSIXN
	TYPEIT	< = >
	LDB	T1,[POINT 12,P2,18]
	PUSHJ	P,.TOCTW
	POP	P,P1		;GET INDEX BACK
	POPJ	P,0		;AND GO BACK

DXMES:	SIXBIT/STATUS/
	SIXBIT/  MQ  /
	SIXBIT/  DATA/
	SIXBIT/  AC  /

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

MDE011:	XWD	0,RS04CR
	XWD	0,TU16CR
	XWD	0,RP04CR
	XWD	0,RP04CR
	XWD	0,RP04CR

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

	;SOME TABLES

	;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)/]
RP4FUN:	[ASCIZ/ NO OPERATION(00)/]
	[ASCIZ/ STAND BY(02)/]
	[ASCIZ/ SEEK(04)/]
	[ASCIZ/ RECALIBRATE(06)/]
	[ASCIZ/ DRIVE CLEAR(10)/]
	[ASCIZ/ RELEASE(12)/]
	[ASCIZ/ OFFSET(14)/]
	[ASCIZ/ RETURN CENTERLINE(16)/]
	[ASCIZ/ READ-IN(20)/]
	[ASCIZ/ PACK ACK.(22)/]
	[ASCIZ/	ILLEGAL(24)/]
	[ASCIZ/ ILLEGAL(26)/]
	[ASCIZ/ SEARCH(30)/]
	[ASCIZ/ ILLEGAL(32)/]
	[ASCIZ/ ILLEGAL(34)/]
	[ASCIZ/ ILLEGAL(36)/]
	[ASCIZ/ ILLEGAL(40)/]
	[ASCIZ/ ILLEGAL(42)/]
	[ASCIZ/ ILLEGAL(44)/]
	[ASCIZ/ ILLEGAL(46)/]
	[ASCIZ/ WRITE CHECK DATA(50)/]
	[ASCIZ/ WRITE CHECK HEADER & DATA(52)/]
	[ASCIZ/ ILLEGAL(54)/]
	[ASCIZ/ ILLEGAL(56)/]
	[ASCIZ/ WRITE DATA(60)/]
	[ASCIZ/ WRITE HEADER & DATA(62)/]
	[ASCIZ/ ILLEGAL(64)/]
	[ASCIZ/ ILLEGAL(66)/]
	[ASCIZ/ READ DATA(70)/]
	[ASCIZ/ READ HEADER&DATA(72)/]
	[ASCIZ/ ILLEGAL(74)/]
	[ASCIZ/ ILLEGAL(76)/]
TU6FUN:	[ASCIZ/ NO OPERATION(00)/]
	[ASCIZ/ REWIND,OFFLINE(02)/]
	[ASCIZ/ ILLEGAL(04)/]
	[ASCIZ/ REWIND(06)/]
	[ASCIZ/ DRIVE CLEAR(10)/]
	[ASCIZ/ ILLEGAL(12)/]
	[ASCIZ/ ILLEGAL(14)/]
	[ASCIZ/ ILLEGAL(16)/]
	[ASCIZ/ READIN(20)/]
	[ASCIZ/ ILLEGAL(22)/]
	[ASCIZ/ ERASE(24)/]
	[ASCIZ/ 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 RP04 OFFSET REG.
RP04MO:	HRRZ	P4,T1
	TYPEIT	<AT END:>
	TRNE	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
	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,>
	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		;ONLY CYL BITS WANTED
	MOVE	T2,MDEDTP	;[310] GET DEVICE TYPE
	CAIE	T2,4		;RP06?
	 TRZ	T1,10000	;NO-CLEAR EXTRA BITS
	PJRST	.ODECW
	;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	<TCW,>
	TRNN	P4,1B22
	 JRST	.+3
	TYPEIT	< FCS,>
	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/ 1600BPI PE/]

TU6FOR:	[ASCIZ/ 10 CORE-DUMP/]
	[ASCIZ/ 10 7-TRACK/]
	[ASCIZ/	UNKNOWN/]
	[ASCIZ/ 10 COMPATIBLE/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]
	[ASCIZ/ UNKNOWN/]


	;CONTROL TABLES FOR USE WITH HWDUMP ROUTINE
	;LH = KONTYP TABLE INDEX FOR THIS REG IF SINGLE BIT
	; 	TRANSLATION OR -1 FOR SPECIAL ROUTINE
	;RH = ADDR TO ENGLISH BIT TABLES (XXXXDV) FOR JFLOOP
	; 	OR ADDR OF SPEC ROUTINE.

RP04CT:	XWD 	-1,RP04CR
	XWD	20,RP04SR
	XWD	21,RP04ER
	XWD	37,RPMRDV
	XWD	-1,NOTRAN
	XWD	-1,RP04BA
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,RP04MO
	XWD	-1,RP04DC
	XWD	-1,RP04DC
	XWD	22,RP04CB
	XWD	23,RP04DA
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
;TABLE USED FOR BOTH RP05&RP06
RP05CT:	XWD 	-1,RP04CR
	XWD	20,RP04SR
	XWD	21,RP04ER
	XWD	37,RPMRDV
	XWD	-1,NOTRAN
	XWD	-1,RP04BA
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,RP04MO
	XWD	-1,RP04DC
	XWD	-1,RP04DC
	XWD	34,RP05DV
	XWD	35,RP06DV
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN


RS04CT:	XWD	-1,RS04CR
	XWD	24,RS04SR
	XWD	25,RS04ER
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,RS04BA
	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


TU16CT:	XWD	-1,TU16CR
	XWD	26,TU16SR
	XWD	27,TU16ER
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,TU16TC
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
	XWD	-1,NOTRAN
DEVTYP:0
	0
	SOFTDV
	TM10DV
	RH10DV
	RH20DV
	DX10DV
	TC10DV
	DL10DV
	DL11DV
	0
	0
	0
	0
	0
	0
	RP04SR
	RP04ER
	RP04CB
	RP04DA
	RS04SR
	RS04ER
	TU16SR
	TU16ER
	ICPCX1
	DXTAGB
	DXSB03
	DXSB47
	RP05DV
	RP06DV
	SB81DV
	RPMRDV


	;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

BCK2:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;PICKUP CHAR WORD
	TLNE	P2,E.LSUM	;SUMMARY DESIRED
	PUSHJ	P,SUM2
	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)
	TLNN	F,F.DEV
	 JRST	BC2.A
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV
	 JRST	ABORT
	TLO	P2,E.LALL
BC2.A:	TLNE	P2,E.LALL	;WANT'S ALL?
	 POPJ	P,0		;YUP
	TLNE	P2,E.LPER	;WHAT ABOUT PERFORMANCE?
	 POPJ	P,0		;OK-DO IT
	JRST	ABORT		;THAT'S ALL


BCK4:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;PICKUP CHAR WORD
	TLNE	P2,E.LSUM	;SUMMARY DESIRED
	PUSHJ	P,SUM4
	TLNN	F,F.DEV
	 JRST	BC4.A
	MOVE	T1,[SIXBIT/CPU/]
	CAME	T1,DEV
	MOVE	T1,[SIXBIT/KLCPU/]
	CAME	T1,DEV
	 JRST	ABORT
	TLO	P2,E.LALL
BC4.A:	TLNN	P2,E.LALL!E.LNXM
	JRST	ABORT		;LOSE
	POPJ	P,		;WIN LIST IT



BCK11:	MOVE	P1,ERTYPE
	MOVE	P4,ENTCHR(P1)		;GET CHAR WORD
	PUSH	P,P4			;[434]SAVE ENTCHR FOR LATER
	TLNE	P4,E.LSUM		;SUMMARY?
	 PUSHJ	P,SUM11
	TLNN	F,F.TRY		;EDIT 126 SAID /RETRY?
	 JRST	BCK11A		;NO
	HRRZ	T1,WKBUFF+MDETYP	;GET # RETRIES
	CAMG	T1,RETRY	;ENTRY VALUE GREATER
	 JRST	ABORT		;NO-DON'T LIST
BCK11A:	TRNN	F,F.NDEV	;[325]/NDEV?
	JRST 	BC11A1		;NOPE
	MOVEI	P3,MDENAM
	PUSHJ	P,NDVCHK##
BC11A1:	TLNN	F,F.DEV		;SAID /DEV:?
	 JRST	BC11.1			;NO
	SETOM	T2,T2
	MOVE	T1,DEV
	CAMN	T1,[SIXBIT/RP04/]
	MOVEI	T2,5
	CAMN	T1,[SIXBIT/RP05/]
	MOVEI	T2,6
	CAMN	T1,[SIXBIT/RP06/]
	MOVEI	T2,7
	CAMN	T1,[SIXBIT/RS04/]
	MOVEI	T2,4
	CAMN	T2,MDEDTP
	 JRST	.+3
	MOVEI	P3,MDENAM
	PUSHJ	P,DEVCHK
	POP	P,P4		;[434]GET ENTCHR BACK
	TLNE	F,F.OSUM
	TLO	P4,E.LALL
	PUSH	P,P4		;BUT STILL SAVE IT
BC11.1:	TLNN	F,F.ID			;SAID /ID:?
	 JRST	BC11.2
	MOVEI	P3,MDEMID
	PUSHJ	P,IDCHK
BC11.2:	TLNN	F,F.STR		;SAID /STR:?
	 JRST	BC11.3
	MOVEI	P3,MDESTR
	PUSHJ	P,STRCHK
BC11.3:	POP	P,P4		;[434]GET ENTCHR BACK
	TLNE	P4,E.LALL		;WANTS ALL?
	 POPJ	P,0			;OK
	TLNN	P4,E.LNXM		;HOW ABOUT NXM
	 JRST	BC11.5			;NO-CHECK PARITY
	HLRZ	T1,WKBUFF+MDETYP	;GET CONTROLLER TYPE
	TRNN	T1,1B32			;RH10?
	 JRST	BC11.4			;NO
	MOVE 	T2,WKBUFF+MDECNI	;YES-GET CONI WORD
	TLNE	T2,1B35			;NXM ON?
	 POPJ	P,0			;YES;LIST IT
	JRST	BC11.5			;NO-CHECK PARITY
BC11.4:	MOVE	T2,WKBUFF+MDECNI	;GET CONI
	TRNE	T2,1B22			;M-BOX ERROR COULD BE NXM?!!
	 POPJ	P,0			;LIST IT
	JRST	BC11.5			;NOLUCK CHECK PARITY
BC11.5:	TLNN	P4,E.LPAR		;CARE ABOUT PARITY ERRORS?
	 JRST ABORT			;NO THAT'S ALL I COVER
	HRRZ	T1,WKBUFF+MDEDDT	;GET DEVICE TYPE
	ANDI	T1,77	
	TRNE	T1,2			;RS04?
	JRST	BC11.7			;YUP
	TRNE	T1,20			;RP04?
	JRST	BC1112			;YUP
	JRST	BC1110			;MUST BE TU16

BC11.7:	HRRZ	T1,WKBUFF+MDEDER	;ERROR REG
	TRNN	T1,1B32			;PARITY SET?
	 JRST	BC1112			;NO-CHECK CONTROLLER
	POPJ	P,0			;LIST	IT
BC1110:	HRRZ	T1,WKBUFF+MDEDER
	TRNN	T1,1B29!1B30!1B32	;THESE ARE POSSIBLE
	 JRST	BC1112			;NO
	POPJ	P,0
BC1111:	HRRZ	T1,WKBUFF+MDEDER
	TRNE	T1,1B20!1B29!1B32	;CHOICES
	 POPJ	P,0			;ONE SET AT LEAST
	HRRZ	T1,WKBUFF+MDEDCB	;ERROR REG #2
	TRNE	T1,1B21			;CHOICE
	 POPJ	P,0			;SET-LIST IT
			;OR FALL INTO

	;HERE TO CHECK PARITY ERRORS DET BY THE CONTROLLER
BC1112:	HLRZ	T1,WKBUFF+MDETYP	;KONTROLLER TYPE
	TRNN	T1,1B32			;RH10?
	 JRST	BC1113			;NO
	MOVE	T1,WKBUFF+MDECNI
	TDNE	T1,[1B15!1B16!1B18]	;CHOICES
	 POPJ	P,0			;LIST IT
	JRST	ABORT			;FORGET IT
BC1113:	MOVE	T1,WKBUFF+MDECNI
	TDNE	T1,[1B18!1B22]		;OTHER CHOICES
	 POPJ	P,0			;LIST
	JRST ABORT			;FORGET IT

BCK15:	TLNN	F,F.DEV		;USER SAY /DEV?
	JRST	BC15.1		;NO GO AROUND
	MOVEI	P3,CSCNAM	;SET UP
	PUSHJ	P,DEVCHK		;AND CHECK IT
BC15.1:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;GET CHARACTERISTICS
	TLNN	P2,E.LALL!E.LPER	;WANT ALL OR PER?
	JRST	ABORT		;LOSE
	POPJ	P,0		;WIN
BCK21:	MOVE	P1,ERTYPE
	MOVE	P4,ENTCHR(P1)
	TLNE	P4,E.LSUM
	 PUSHJ	P,SUM21
	TLNN	F,F.TRY	;EDIT 126 SAID /RETRY:?
	 JRST	BCK21A
	HRRZ	T1,WKBUFF+TAPTRY	;GET RETRIES
	CAMG	T1,RETRY		;ENTRY VALUE GREATER?
	 JRST	ABORT			;NO-DONT LIST IT
BCK21A:	TRNN	F,F.NDEV	;[325]
	 JRST	BC21AA
	MOVEI	P3,TAPNAM
	PUSHJ	P,NDVCHK
BC21AA:	TLNN	F,F.DEV	;/DEV?
	 JRST	BC21.1
	MOVEI	P3,TAPNAM
	PUSHJ	P,DEVCHK
BC21.1:	TLNN	F,F.ID		;/ID?
	 JRST	BC21.2
	MOVEI	P3,TAPRID
	PUSHJ	P,IDCHK
BC21.2:	TLNE	P4,E.LALL
	 POPJ	P,0
	TLNN	P4,E.LPAR
	 JRST 	ABORT
	HLRZ	T1,WKBUFF+TAPTRY	;GET CONTROLLER TYPE
	ANDI	T1,70
	CAIN	T1,30		;DX10?
	 JRST 	BC21.4		;YES
	CAIN	T1,40		;TM02?
	 JRST	BC21.5		;CHECK FOR PARITY ERRORS
	CAIE	T1,20		;TC10?
	 JRST	BC21.3		;NO-MUST BE TM10
	MOVE	T1,WKBUFF+TAPIEP	;YES-GET CONI
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T2,TC.CNI(T1)	;GET CONI
	TDNE	T2,[1B9!1B10!1B15!1B14]	;COULD BE ANY
	 POPJ	P,0		;LIST IT
	JRST	ABORT		;NONE SET

	;HERE CHECK FOR PARITY ERRORS ON TM10
BC21.3:	MOVE	T1,WKBUFF+TAPIEP	;YES-GET CONI
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T2,TM.CNS(T1)	;GET CONI MTS
	TDNE	T2,[1B11!1B13!1B22]
	 POPJ	P,0		;LIST
	JRST	ABORT

	;HERE FOR DX10

BC21.4:	MOVE	T1,WKBUFF+TAPIEP	;YES-GET CONI
	SUB	T1,HEADWC
	ADDI	T1,WKBUFF
	MOVE	T2,XS.CNI(T1)
	TRNE	T2,1B27		;MEM PAR?
	 POPJ	P,0		;YES
	MOVE	T2,XS.ST1(T1)	;ICPC+1
	TLNE	T2,1B31		;DEV PAR ERR?
	 POPJ	P,0		;YES
	MOVE	T2,XS.S0(T1)	;SENSE BYTES 0-3
	TLNE	T2,1B22		;DATA CHECK?
	 POPJ	P,0		;YES
	JRST	ABORT		;THAT'S ALL FOLKS


	;HERE CHECK FOR PARITY ERRORS ASSOCIATED WITH RH10&TM02
BC21.5:	MOVE	P1,WKBUFF+TAPIEP	;GET WRROR POINTER
	SUB	P1,HEADWC
	ADDI	P1,WKBUFF
	MOVE	T1,T2.CNI(P1)	;CONI AT ERROR
	TDNE	T1,[1B15!1B16!1B18]	;RH10 ERROR BITS FOR PARITY
	 POPJ	P,0		;LIST ENTRY
	MOVE	T1,T2.DER(P1)	;GETDRIVE ERROR REG
	TDNE	T1,[1B20!1B25!1B28!1B29!1B30!1B31!1B32]
	POPJ	P,0		;LIST ENTRY
	JRST	ABORT		;NONE SET-DON'T LIST
BCK50:	MOVE	P1,ERTYPE
	MOVE	P4,ENTCHR(P1)
	TLNE	P4,E.LALL	;THIS IS ALL WE CHECK
	 POPJ	P,0		;YES,LIST IT
	JRST ABORT		;SORRY

BCK42:	MOVE	P1,ERTYPE
	MOVE	P4,ENTCHR(P1)
	TLNE	P4,E.LSUM
	 PUSHJ	P,SUM42
	TLNN	F,F.DEV		;DID USER SPECIFY DEV.
	JRST	BC42.1		;NO GO AROUND.
	MOVEI	P3,TPSNAM	;GET NAME FROM THIS ENTRY?
	PUSHJ	P,DEVCHK
BC42.1:	TRNN	F,F.NDEV	;[325]
	 JRST		BC42AA
	MOVEI	P3,TPSNAM
	PUSHJ	P,NDVCHK
BC42AA:	TLNN	F,F.ID		;/ID?
	JRST	BC42.2		;NO
	MOVEI	P3,TPSRID	;YES, SETUP
	PUSHJ	P,IDCHK
BC42.2:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;GET CHAR WORD
	TLNE	P2,E.LALL	;WANTS ALL?
	JRST	BC42.3		;YES,BUT CHECK SRE&SWE
	TLNN	P2,E.LPER	;WANTS PERFORMANCE STATS?
	JRST 	ABORT		;NO, GOODBYE
BC42.3:	SKIPE	WKBUFF+TPSHRE	;YES, ANY HARD READ ERRORS?
	POPJ	P,0		;YES,LIST.
	SKIPE	WKBUFF+TPSHWE	;NO, WHAT ABOUT HARD WRITE ERRORS?
	POPJ	P,0		;YES.
	MOVE	T1,WKBUFF+TPSSRE	;GET # OF SOFT READ ERRORS
	CAML	T1,SRE		;ERRORS G.T. THRESHOLD?
	POPJ	P,0		;YES LIST
	MOVE	T1,WKBUFF+TPSSWE	;GET # OF SOFT WRITE ERRORS.
	CAML	T1,SWE		;ERRORS G.T. THRESHOLD?
	POPJ	P,0		;YES, LIST
	JRST	ABORT		;NO, FORGET IT.

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

MSEINS:	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



SUM4:	MOVEI	T1,TNETMP
	MOVEI	T2,TNEPER
	MOVE	T3,WKBUFF+NXMTNE	;PICKUP # HARD NXM
	PUSHJ	P,COMPAR	;LET SUBROUTINE DO UPDATING AS NECESSARY
	MOVEI	T1,SNETMP	
	MOVEI	T2,SNEPER
	MOVE	T3,WKBUFF+NXMSNE	;PICKUP # SOFT MEM NXM
	PUSHJ	P,COMPAR
	MOVEI	T1,NUETMP
	MOVEI	T2,NUEPER
	MOVE	T3,WKBUFF+NXMUEN	;PICKUP # USER-ENABLED NXM
	PUSHJ	P,COMPAR
	MOVEI	T1,NCSTMP
	MOVEI	T2,NCSPER
	MOVE	T3,WKBUFF+NXMNCS	;PICKUP # CHN NXM NOT DETECTED BY CPU
	PUSHJ	P,COMPAR
	POPJ	P,		;DONE WITH SUM4
SUM11:	SETOM	MASONE		;AT LEAST ONE ENTRY SEEN FOR SML10
	MOVE	T1,MASKON		;TYPE CONTROLLER STORED BY MDECHR
	MOVEM	T1,KONTYP
	MOVEI	P2,MDETYP		;RETRY WORD OFFSET
	MOVEI	P3,MDECNI		;CONI WORD OFFSET
	PUSHJ	P,CNISUM		;LET IT WORK
	MOVE	P1,DVINDX
	HRRZ	P2,SOFDSP(P1)		;GET STARTING
	HLRZ	P1,SOFDSP(P1)		;ADDRESSES
	MOVEI	T1,ERRSAT(P1)
	MOVEI	T2,ERRSAT(P2)
	LDB	T3,[POINT 12,WKBUFF+MDESF1,11]	;PICKUP # SAT FAILS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG	;DID COUNT CHANGE ON THIS ERROR
	TLO	S,S.SAT		;SAY SAT FAILURE
	MOVEI	T1,ERRRIB(P1)
	MOVEI	T2,ERRRIB(P2)
	LDB	T3,[POINT 12,WKBUFF+MDESF1,23]	;PICKUP # RIB ERRS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.RIB
	MOVEI	T1,ERRCHK(P1)
	MOVEI	T2,ERRCHK(P2)
	LDB	T3,[POINT 12,WKBUFF+MDESF1,35]	;PICKUP # CHKSUM ERRS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.CHK

	MOVEI	T1,ERRINC(P1)
	MOVEI	T2,ERRINC(P2)
	HRRZ	T3,WKBUFF+MDESF2	;[302PICKUP # SEEK INCOMP ERRORS
	PUSHJ	P,COMPAR
	MOVEI	T1,ERRHN1(P1)
	MOVEI	T2,ERRHN1(P2)
	LDB	T3,[POINT 9,WKBUFF+MDESF3,8]	;PICKUP # HARD HANGS
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG1
	MOVEI	T1,ERRHN2(P1)
	MOVEI	T2,ERRHN2(P2)
	LDB	T3,[POINT 9,WKBUFF+MDESF3,17]	;PICKUP # SOFT HANG TYPE 1
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG2
	MOVEI	T1,ERRHN3(P1)
	MOVEI	T2,ERRHN3(P2)
	LDB	T3,[POINT 9,WKBUFF+MDESF3,26]	;PICKUP # SOFT HANGS TYPE 2
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG3
	MOVEI	T1,ERRHN4(P1)
	MOVE	T2,ERRHN4(P2)
	LDB	T3,[POINT 9,WKBUFF+MDESF3,35]	;PICKUP # SOFT HANGS TYPE 3
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.HNG4
	MOVEI	T1,ERRCWF(P1)
	MOVEI	T2,ERRCWF(P2)
	LDB	T3,[POINT 9,WKBUFF+MDECCT,35]	;# CCW TERM FAILURES
	PUSHJ	P,COMPAR
	TLNE	F,F.CHNG
	TLO	S,S.CWF
	;HERE TO START SUMMING DEVICE ERROR REGISTERS

	MOVE	P3,WKBUFF+MDETYP	;SETUP P3 WITH RETRY WORD
	HRRZ	T1,WKBUFF+MDEDDT	;GET DEVICE TYPE
	ANDI	T1,77			;ALONE
	CAIN	T1,2			;RS04?
	PJRST	S11.2			;YES
	CAIL	T1,20			;RP04,5,OR6
	PJRST	S11.4			;YUP
	PJRST	S11.3			;MUST BE TU16 (BETTER BE OR...)

	;HERE FOR RS04
S11.2:	MOVE	P1,MASIND		;GET OFFSET FOR THIS DEV
	MOVS	P2,MASDSP(P1)		;COUNTER ADDRESSES
	HRLZ	P1,WKBUFF+MDEDER	;WORD TO SUMMATE
	MOVEI	T1,25			;OFFSET FOR RS04 ERROR REG
	MOVEM	T1,KONTYP
	PJRST	MASSVM

	;HERE DO TU16
S11.3:	MOVE	P1,MASIND		;GET OFFSET FOR THIS DEV
	MOVS	P2,MASDSP(P1)		;COUNTER ADDRESSES
	HRLZ	P1,WKBUFF+MDEDER	;WORD TO SUMMATE
	MOVEI	T1,27			;OFFSET FOR TU16 ERROR REG
	MOVEM	T1,KONTYP
	PJRST	MASSVM


	;HERE DO RP04'S
S11.4:	MOVE	P1,MASIND		;GET OFFSET FOR THIS DEV
	MOVS	P2,MASDSP(P1)		;COUNTER ADDRESSES
	HRLZ	P1,WKBUFF+MDEDER	;WORD TO SUMMATE
	MOVEI	T1,21			;OFFSET FOR RP04 ERROR REG
	MOVEM	T1,KONTYP
	PUSHJ	P,MASSVM
	HLRZ	T1,P2
	ADDI	T1,NURP02		;INCREASE TO POINT AT 2ND
	HRL	P2,T1		;PUT IT BACK
	HRRZ	T1,P2			;RH
	ADDI	T1,NURP02
	HRR	P2,T1
	AOS	KONTYP			;KONTYP=22
	HRLZ	P1,WKBUFF+MDEDCB	;2ND WORD
	PUSHJ	P,MASSVM
	HLRZ	T1,P2		;INCREASE TO # 3
	ADDI	T1,NURP10
	HRL	P2,T1		;PUT IT BACK
	HRRZ	T1,P2
	ADDI	T1,NURP10
	HRR	P2,T1
	AOS	KONTYP		;=23
	HRLZ	P1,WKBUFF+MDEDDA	;3RD WORD
	PUSHJ	P,MASSVM
	SKIPN	HDVER1	;VERSION 1 HEADER OF ENTRY?
	 POPJ	P,0	;NO-LEAVE NOW
	LDB	T2,[POINT 9,WKBUFF+MDECCT,17]
	CAIL	T2,5	;<5-GIVE WARNING
	 POPJ	P,0	;ITS OK
	MOVE	T2,WKBUFF+MDESTR	;GET STR NAME
	PUSHJ	P,TTYSIX	;CONVERT AND DUMP ON USER'S TTY
	WARN	< STRUCTURE FOUND WITH LESS THAN 5 BAT BLOCK SLOTS LEFT>
	 ;GIVE WARN NOW AND GET FREE CRLF
	POPJ	P,0
SUM15:	POPJ	P,0	;FOR NOW
SUM30:	POPJ	P,0	;FOR NOW


SUM21:	PUSHJ	P,.SAVE4	;SAVE A FEW
	MOVE	P3,WKBUFF+TAPNAM
	TRNE	P3,7777		;EDIT 132 FUNNY NAME?
	 PUSHJ	P,FIXNAM	;GO FIX
	MOVE	T1,[IOWD NAMLTH,NAMTBL]
	PUSHJ	P,.NAME
	 JRST 	BADNAM
	TLZ	T1,-1
	SUBI	T1,NAMTBL
	MOVE	P1,DEVDSP(T1)	;GET HD & SF ADDRS
	MOVE	P2,WKBUFF+TAPIEP
	SUB	P2,HEADWC
	ADDI	P2,WKBUFF	;SETUP P2 FOR LATER
	HLRZ	T2,WKBUFF+TAPTRY
	HRRZ	P3,P1		;SET FOR SOFT BUT
	TRNE	T2,ERRHRD	;IF HARD
	 HLRZ	P3,P1		;CHANGE IT
	ANDI	T2,70		;CONTROLLER TYPE
	CAIE	T2,30		;DX10?
	 JRST	S21.1		;NO
	MOVE	T1,XS.CNI(P2)	;YES GET CONI
	TRNE	T1,1B27		;MEM PAR?
	 AOS	,1(P3)		;YUP-BUMP COUNT
	TRNE	T1,1B28		;NXM?
	 AOS	,2(P3)
	TRNE	T1,1B26		;MP ERR?
	 AOS	,5(P3)
	POPJ	P,0		;RETURN P1-P4 TOO

	;HERE FOR TC10 OR TM10
S21.1:	CAIE	T2,20		;TC10?
	 JRST	S21.2		;MUST BE TM10
	MOVE	T1,TC.CNI(P2)	;GETS CONI
	TLNE	T1,1B22		;UNIT HNG?
	 AOS	,4(P3)		;YUP
	TLNE	T1,1B31		;OVERRUN?
	 AOS	,3(P3)
	HLRZ	T1,T1
	ANDI	T1,14		;GET REAL BITS 14 &15 ALONE
	CAIN	T1,14		;NXM?
	 AOS	,2(P3)		;YUP
	CAIN	T1,10		;CTL PAR?
	 AOS	,0(P3)
	CAIN	T1,4		;MEM PAR?
	 AOS	,1(P3)
	POPJ	P,0		;DONT FORGET P1-P4 ALSO

	;HERE FOR TM10 OR TM02
S21.2:	CAIE	T2,10	;TM10?
	 JRST	S21.3	;DO TM02
	MOVE	T1,TM.CNS(P2)	;CONI MTS
	HLRZ	T2,WKBUFF+TAPTRY	;GET CONTROLLER TYPE
	TRNN	T2,1B32			;TM10A?
	 TDZ	T1,[7B13!1B27!1B31]	;CLR TM10B ONLY BITS
	TLNE	T1,1B29		;CTL PAR?
	 AOS	,0(P3)
	TLNE	T1,1B31		;MEM PAR?
	 AOS	,1(P3)
	TLNE	T1,1B30		;NXM?
	 AOS	,2(P3)
	TRNE	T1,1B18		;UNIT HNG?
	 AOS	,4(P3)
	TRNE	T1,1B27		;OVERRUN?
	 AOS	,5(P3)
	POPJ	P,0		;P1-P4 TOO

	;HERE DO TM02 SUMMARY
S21.3:	MOVE	T1,T2.CNI(P2)	;CONI AT ERROR
	TRNE	T1,1B18		;CTL PAR?
	 AOS	,0(P3)
	TLNE	T1,1B33!1B34	;MEMPAR?
	 AOS	,1(P3)
	TRNE	T1,1B22!1B28	;OVERRUN?
	 AOS	,3(P3)
	TLNE	T1,1B35		;NXM?
	 AOS	,2(P3)
	MOVE	T1,T2.DER(P2)	;GET DEVICEERROR REG
	TDNE	T1,[1B20!1B25!1B28!1B29!1B30!1B31!1B32]	;ERROR BITS
	AOS	,6(P3)
	PUSH	P,T1		;SAVE THIS REGISTER CONTENTS
	;NOW SUMMATE DEVICE REGISTER
	MOVE	P3,WKBUFF+TAPNAM	;GET DEVICE NAME
	TRNE	P3,7777
	PUSHJ	P,FIXNAM
	MOVE	T1,[IOWD MASLTH,MASNAM]
	PUSHJ	P,.NAME
	 JRST	BADNAM
	TLZ	T1,-1
	SUBI	T1,MASNAM
	MOVE	P1,T1
	MOVS	P2,MASDSP(P1)
	POP	P,T1		;GET REGISTER CONTENTS BACK
	HRLZ	P3,T1		;FINISH SETUP WITH
	MOVEI	T1,27		;OFFSET TO TU16 ERROR REG
	MOVEM	T1,KONTYP
	PJRST	MASSVM	;GO DO SUMMARY
SUM40:	POPJ	P,


SUM50:	POPJ	P,0	;NOTHING TO SUM


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


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

	;NOW THE ACTUAL CODE GENERATION

;	XLIST
SUMUPD:	DUMFLG
	LIST


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

	POPJ	P,		;RETURN
	SUBTTL	STORAGE LOCATIONS
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
	RH20SK
	DXMASK
	TCMASK
	DL1MSK
	DL2MSK
	KLAMSK
	0
	0
	0
	0
	0
	P4SRSK
	P4ERSK
	P4CBSK
	P4DASK
	S4SRSK
	S4ERSK
	T6SRSK
	T6ERSK
	ICPCSK
	DXTBSK
	SB03SK
	SB47SK
	RP05SK
	RP06SK
	SB81SK
	RPMRSK

MINERB:	0
	0
	MINSFB
	MINTMB
	MINRHB
	 MINRH2
	MINDXB
	MINTCB
	MINDL1
	MINDL2
	MINKLA
	0
	0
	0
	0
	0
	MIRP01
	MIRP02
	MIRP10
	MIRP15
	MIRS01
	MIRS02
	MIT601
	MIT602
	MIICPC
	MIDXTB
	MISB03
	MISB47
	MIRP05
	MIRP06
	MISB81
	MIRPMR

ERINDX:	0
	0
	SFINDX
	TMINDX
	RHINDX
	RH20DX
	DXINDX
	TCINDX
	DL1IND
	DL2IND
	0
	0
	0
	0
	0
	0
	RP01DX
	RP02DX
	RP10DX
	RP15DX
	RS01DX
	RS02DX
	T601DX
	T602DX
	ICPCDX
	DXTBDX
	SB03DX
	SB47DX
	RP05DX
	RP06DX
	SB81DX
	RPMRDX
IDVFLT:	SIXBIT/SYS/		;DEFAULT FILE SPECIFICATIONS
IFLFLT:	SIXBIT/ERROR/
IEXFLT:	SIXBIT/SYS/
ODVFLT:	SIXBIT/DSK/
OFLFLT:	SIXBIT/ERROR/
OEXFLT:	SIXBIT/LST/

PDLPNT:	IOWD	LPDL,PDLST
	SUBTTL	DUMMY MACRO EXPANSION AREA


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

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

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

ALLTBL:	DUMENT

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

	DEFINE	TBLENT(A,B,C,D,E)<
	IFIDN<D><PROCSB><
	XWD  0,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><PROCSB><
	XWD	C,D
	TYPMAX==A>
	IFDIF<D><PROCSB><
	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><PROCSB><
	[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><PROCSB><
	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><PROCSB><
	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>

>
	RADIX	10		;*********NOTE WELL***********
.CT002:	DUM002
	Z
.CT004:	DUM004
	Z
.CT011:	DUM011
	Z
.CT015:	DUM015
	Z
.CT021:	DUM021
	Z
.CT042:	DUM042
	Z
.CT050:	DUM050
	Z

	RADIX	8

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

	DEFVAL


	;NOW MAKE SWTCHS MACRO FOR USE WITH DOSCAN LATER

	DEFINE	SWTCHS<
	DUMCH1
	DUMCH2
>

	DOSCAN(SWTAB)


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


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

	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
	RH20DV:	DUMRH2
	RP05DV:	DURP05
	RP06DV:	DURP06
	SB81DV:	DUSB81
	RPMRDV:	DURPMR


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



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

;	XLIST
SB81DX:	REPEAT	36-MISB81,<0>
	LIST
	ZZ==0
	DUSB81
	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	RPMRDX+A-MIRPMR
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>

;	XLIST
RPMRDX:	REPEAT	36-MIRPMR,<0>
	LIST
	ZZ==0
	DURPMR

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

;	XLIST
TCINDX:	REPEAT	36-MINTCB,<0>
	LIST
	ZZ==0
	DUMTC1


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

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

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

	DEFINE TBLDEV(A,B)<
	ZZP==.
	RELOC	RP01DX+A-MIRP01
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>
;	XLIST
RP01DX:	REPEAT	36-MIRP01,<0>
	LIST
	ZZ==0
	DURP01
	DEFINE TBLDEV(A,B)<
	ZZP==.
	RELOC	RP02DX+A-MIRP02
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>
;	XLIST
RP02DX:	REPEAT	36-MIRP02,<0>
	LIST
	ZZ==0
	DURP02

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

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

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

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

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

	DEFINE TBLDEV(A,B)<
	ZZP==.
	RELOC	T602DX+A-MIT602
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>
;	XLIST
T602DX:	REPEAT	36-MIT602,<0>
	LIST
	ZZ==0
	DUT602
	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	DXINDX+A-MINDXB
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>

;	XLIST
DXINDX:	REPEAT	36-MINDXB,<0>
	LIST
	ZZ==0
	DUMDX1
	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	ICPCDX+A-MIICPC
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>

;	XLIST
ICPCDX:	REPEAT	36-MIICPC,<0>
	LIST
	ZZ==0
	DUICPC

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

;	XLIST
DXTBDX:	REPEAT	36-MIDXTB,<0>
	LIST
	ZZ==0
	DUDXTB

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

;	XLIST
SB03DX:	REPEAT	36-MISB03,<0>
	LIST
	ZZ==0
	DUSB03

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

;	XLIST
SB47DX:	REPEAT	36-MISB47,<0>
	LIST
	ZZ==0
	DUSB47



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

;	XLIST
DL1IND:	REPEAT	36-MINDL1,<0>
	LIST
	ZZ==0
	DUMDL1

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

;	XLIST
DL2IND:	REPEAT	36-MINDL2,<0>
	LIST
	ZZ==0
	DUMDL2


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

;	XLIST
RH20DX:	REPEAT	36-MINRH2,<0>
	LIST
	ZZ==0
	DUMRH2
	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	RP05DX+A-MIRP05
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
>

;	XLIST
RP05DX:	REPEAT	36-MIRP05,<0>
	LIST
	ZZ==0
	DURP05

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

;	XLIST
RP06DX:	REPEAT	36-MIRP06,<0>
	LIST
	ZZ==0
	DURP06







	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
	;EDIT 305 ADDED DUMTM
MASNAM:	DUMFS
	DUMRP
	DUMTM
	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
	;EDIT 305 ADDED DUMTM
	DEFINE	DUMDV (A)<
	XWD	A'DS, A'DH
	>
MASDSP:	DUMFS
	DUMRP
	DUMTM


	END	STARTB