Google
 

Trailing-Edge - PDP-10 Archives - BB-H138A-BM - 3a-sources/syserb.mac
There are 15 other files named syserb.mac in the archive. Click here to see a list.
;<BAKER.SYSERR>SYSERB.MAC.7, 28-Jul-78 13:39:08, Edit by BAKER
;<BAKER.SYSERR>SYSERB.MAC.6, 21-Jul-78 13:22:16, Edit by BAKER
;<BAKER.SYSERR>SYSERB.MAC.5, 21-Jul-78 13:15:37, Edit by BAKER
;<BAKER.SYSERR>SYSERB.MAC.4, 20-Jul-78 17:20:43, Edit by BAKER
;<BAKER.SYSERR>SYSERB.MAC.3, 12-Jul-78 11:19:19, Edit by BAKER
;<BAKER.SYSERR>SYSERB.MAC.2, 11-Jul-78 09:56:25, Edit by DRUEKE
;FIX ENTRY SWITCH
;<SYSERR>SYSERB.MAC.3,  4-Jul-78 11:40:29, EDIT BY WOJCIK
;HERE TO FIX UNDEFINED GLOBAL A TAPL01+1
;<SYSERR>SYSERB.MAC.2, 26-Jun-78 11:34:19, EDIT BY IQL-BAKER
;<SYSERR>SYSERB.MAC.1, 22-Jun-78 11:18:50, EDIT BY WOJCIK
;HERE WE BEGIN TRACKING EDITS



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





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

	SEARCH	SYRUNV
	SEARCH	SYRLOW	;LOW SEG DEFINITIONS


	.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
	DUM016	;[715]
	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,MASNA2,MDE000
	


	.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:	BLOCK	1		;GIVE IT SOME SPACE

	;PROCSA -- STANDARD ENTRY PROCESSOR #1
	;CALL	JRST PROCSB
	;
	;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:	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,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
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/]
	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
	TRNN	F,F.ENT		;/ENTRY ?  [752]
	TRNE	F,F.SEQ
	 JRST	START1
	TLNN	T2,E.LALL!E.LNXM!E.LPAR!E.LPER!E.LSUM	;ANY LISTING DESIRED
	JRST	SKIPIT		;SKIP THIS ENTRY
	TLNE	T2,E.LNXM!E.LPAR!E.LPER!E.LSUM	;ANY REASON TO DO BIT CHECKING?
	TLO	F,F.BTCK	;YES-SET FLAG TO DO IT LATER
START1:	MOVE	T3,ERTYPE	;GET CORRECT INDEX
	AOS	ENTCHR(T3)	;NO- BUMP COUNTER
	SETZ	WKINDX,		;CLEAR INDEX INTO BUFFER
	SKIPG	T1,ENTRWC	;PICKUP ENTRY LENGTH AND CHECK FOR LEGALITY
	FATAL	<ENTRY WITH ZERO LENGTH BODY SPECIFIED>
	MOVE	P4,ERRIND
	TLNE	F,F.BTCK	;ANY TO DO?
	PUSHJ	P,@BITCHK(P4)	;GO DO IT
	TRNE	F,F.REM		;[417]/REMOTE?
	 PUSHJ	P,REMDAT##
	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>
	SINDEX	<TASCI>

	;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:	SETZ	P1,
	PUSHJ	P,DETCHK
	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:	SETZ P1,
	PUSHJ	P,DETCHK
	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
	;ADDED WITH [551]
	MOVEI T1,RH2HDR		;ASSUME AN RH20
	CAIE	P3,5		;IS IT??
	 MOVEI	T1,RH1HDR	;NO,CHANGE
	SETOM	@T1		;FLAG THAT WE SAW ONE OR THE OTHER
	;END [551]
	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 # & .
	PUSH	P,P1
	SETZ	P1,
	PUSHJ	P,DETCHK	;/DETAIL??
	POP	P,P1
	TYPEIT	<
CONTROLLER INFORMATION:
	CONTROLLER:	>
	MOVE	P4,WKBUFF+MDETYP	;[552]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:	>
	HRRZ	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:	>
	HRRZ	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	MDE17A		;GO AROUND
MDE017:	TYPEIT	< NO ERROR BITS DETECTED>

	;HERE TO DUMP DATAI'S
MDE17A:	MOVE	T1,KONTYP	;GET KONTROLLER TYPE
	PUSH	P,T1		;SAVE KONTYP
	CAIN	T1,4		;RH20?
	 JRST 	MDE020	;NO, DON'T LIST CHN STATUS
	TYPEIT	<
	  CHN STATUS AT ERROR:	>
	HLLZ	T1,WKBUFF+MDECNI
	MOVE P1,T1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	MOVEI	T1,13		;OFFSET IN SYSERB TO RHSW VALUES
	MOVEM	T1, KONTYP
	PUSHJ	P,CNIDCD
	TYPEIT	<
	  CHN STATUS AT END:	>
	HLLZ	T1,WKBUFF+MDECNF
	MOVE P1,T1
	PUSHJ	P,.TXWDW
	TYPEIT	< = >
	PUSHJ	P,CNIDCD
MDE020:	POP	P,T1		;GET KONTYP BACK
	MOVEM 	T1,KONTYP
	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:	SKIPG	WKBUFF+TAPUID	;REAL UNIT ID ?  [746]
	 JRST	TAPL1A		;NO! - SKIP TESTS
	TYPEIT	<
	USER'S ID:	>	;[701-RLD]
	MOVE	T1,WKBUFF+TAPUID ;GET HIS/HER P,PN
	PUSHJ	P,.PPNWW	;LISTED
	TYPEIT	<
	USER'S PROGRAM:	>
	MOVE	T1,WKBUFF+TAPPGM ;AND PROGRAM NAME
	PUSHJ	P,.TSIXN	;IN SIXBIT
	;END [701-RLD]
TAPL1A:	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/RECOVER