Google
 

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





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



	SEARCH	SYRUNV
	SEARCH	SYRLOW
	.REQUIRE SYRLIB


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

	EXTERNAL DAEVER,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,NOTRAN
	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,.TVERW,PTSTRG
	EXTERNAL DUMPOS,TAPPOS,DSKPOS





	;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,MDE000	
	INTERNAL FE$NAM,BLTTAB


	
	;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<
	DUM201
	DUM202
	DUM203
	DUM210
	DUM211
	DUM220
	DUM221
	DUM222
	DUM230
	DUM231
	DUM232
	DUM233
	DUM234
>



	.JBVER==137
	LOC	.JBVER

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


	TWOSEG
	RELOC	400000






	;DUMMY ROUTINES TO LET SYRLIB COMPILE
MDE000:
BLTTAB:
FE$NAM:
KLEDMP:	BLOCK 1		;GIVE IT SOME ROOM


	;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	<UDATE>
	SINDEX	<TASCI>
	SINDEX	<PPNWT>
	;PROCSA -- STANDARD ENTRY PROCESSOR #1
	;CALL	JRST PROCSN
	;
	;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

PROCSN:	TRNE	F,F.BRF		;/BRIEF ?  -  EDIT [724]
	 JRST	NEWCMD##	;YES! - DO IT THAT WAY
	SETZM	OFFSET		;CLAR WORD OFFSET COUNT
	MOVE	P1,(CTINDX)	;PICKUP FIRST WORD IN CONTROL TABL
	JUMPE	P1,ABORT	;ABORT WHEN END OF CTL TABL SEEN
	TLNE	P1,770000	;DO WE NEED TO GET AN AOB POINTER
	PUSHJ	P,GETAOB	;YES-WORD IS IN A RELOCATABL SUBTABLE IN ENTRY
	LDB	T2,[POINT 6,P1,11]	;**WATCHOUT**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,PROCSN	;GET NEXT WORD IN CTL TABLE
	CAILE	T2,WKSIZE	;MAKE SURE THE WORD ASKED FOR IS IN WORK BUFFER
	AOJA	CTINDX,PROCSN	;IGNORE AND GET NEXT WORD
	MOVE	P2,WKBUFF(T2)	;PICKUP DATA WORD IN WORK BUFF
	LDB	T3,[POINT 6,P1,17]	;****WATCHOUT**PICKUP WORD PROCESSES MODE
	CAIG	T3,SUBMAX	;***WATCHOUT***IS IT AN UNKNOWN MODE
	PUSHJ	P,SUBTAB(T3)	;ITS RECOGINIZED
	AOJA	CTINDX,PROCSN	;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 PROCSN
	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,PROCSN	;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 SYSERB.HGH

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

	;HERE IS THE DUMMY PROCSA FOR THIS HIGH SEG
	;IT SAVES THE AC'S AND THEN CALLS OVRLAY FOR REPLACEMENT
	;WITH SYSERB.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 PROCSB

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


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

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



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

STARTN:	MOVEI	T1,CHROUT	;OUR TYPEOUT 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		;DOING /ENTRY?
	 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##	;YES-DO IMAGE BINARY DUMP
	PUSHJ	P,HDRLST
	MOVE	T2,ALLIND
	HRRZ	T1,PCSTBL(T2)
	HLRZ	CTINDX,PCSTBL(T2)	;CONTROL TABLE ADDRESS
	JRST	(T1)

	SUBTTL SPECIAL DECODING ROUTINES

NCUVER:	TYPEIT	(<
	PROGRAM VERSION:  >)
	LDB	T1,[POINT 9,P2,11]	;EDIT 106
	PUSHJ	P,.TOCTW		;OUTPUT MAJOR
	LDB	T1,[POINT 6,P2,17]	;NOW MINOR
	JUMPE	T1,NCUVC		;IF ANY
	SOS	T1			;MAKE ALPHA OFFSET
	IDIV	T1,"Z"-"A"
	JUMPE	T1,NCUVS2
	ADDI	T1,"A"
	PUSH	P,T2
	PUSHJ	P,.TCHAR
	POP	P,T2
NCUVS2:	MOVEI	T1,"A"(T2)	;GET LOW LETTER
	PUSHJ	P,.TCHAR
NCUVC:	MOVEI	T1,"("
	PUSHJ	P,.TCHAR
	LDB	T1,[POINT 18,P2,35]	;CUST VER
	PUSHJ	P,.TOCTW
	MOVEI	T1,")"
	PUSHJ	P,.TCHAR
	POPJ	P,0


;HERE TO LIST THE OPR COMMENTS FROM 220 & 222 ENTRY
;P2 HAS NH%PTR

NETOPR:	SKIPN	P2		;IF NULL
	 POPJ	P,0		;GO BACK?
	MOVE	T2,ERTYPE	;GET ENTRY TYPE
	MOVEI	T1,[ASCIZ/
TEXT FROM CHK11 REPORT:	/]
	CAIE	T2,222		;CHANGE THE TEXT IF IT ISN'T CHK11 REPORT
	MOVEI	T1,[ASCIZ/
TEXT FROM OPERATOR:	/]
	PUSHJ	P,.TSTRG	;SAY EITHER
	HRRZ	T1,P2		;GET START OF TEXT
	ADDI	T1,WKBUFF	;FINISH SETUP
	PUSHJ	P,.TSTRG	;LIST IT
	POPJ	P,0


;HERE TO LIST NEW TOPOLOGY CHANGE  ENTRY
;P2 HAS NH%PTR

NETTOP:	SKIPN	P2		;SHOULDN'T BE BLANK
	 POPJ	P,0		;IT IS?
	TYPEIT	<


	NEW STATE CODE:	>
	HRRZ	T2,WKBUFF(P2)		;GET THE VALUE
	CAIL	T2,TOPMAX		;DO I KNOW?
	 JRST	[TYPEIT	<UNKNOWN TO SYSERR>
		 POPJ	P,0]
	MOVE	T1,TOPLST(T2)		;PNTR TO ASCIZ
	PUSHJ	P,.TSTRG
	POPJ	P,0

TOPLST:	[ASCIZ/0.-LINE OR STATION UP/]
	[ASCIZ/1.-DOWN FOR REC'D CRC,PARITY,ETC ERRORS/]
	[ASCIZ/2.-DOWN FOR REC TIMEOUT ERRORS/]
	[ASCIZ/3.-DOWN FOR REC SELECTION ERRORS/]
	[ASCIZ/4.-DOWN FOR XMIT CRC, PARITY,ETC. ERRORS/]
	[ASCIZ/5.-DOWN FOR RESOURCE ERRORS/]
	[ASCIZ/6.-DOWN FOR OTHER ERRORS/]
	[ASCIZ/7.-PUT IN MAINT. MODE 1 BY OPR./]
	[ASCIZ/8.-PUT IN MAINT. MODE 2 BY OPR./]
	[ASCIZ/9.-PUT IN MAINT. MODE 3 BY OPR./]
	[ASCIZ/10.-PUT IN MAINT. MODE 4 BY OPR./]
	[ASCIZ/11.-PUT IN MAINT. MODE 5 BY OPR./]
	[ASCIZ/12.-TURNED OFF BY OPR OR COMMON CARRIER DISCONNECT/]
	[ASCIZ/13.-NODE IS IN SHUT STATE/]
	[ASCIZ/14.-NODE IS UP/]
	[ASCIZ/15.-NODE IS DOWN/]

	TOPMAX==^D15	;MAX WE KNOW IN ABOVE LIST
NL$RTN:	LDB	P1,[POINT 8,WKBUFF+NL%RTN,35]	;GET RETURN STATUS
	CAIN	P1,1				;GOOD RELOAD?
	 POPJ	P,0				;YES! - LEAVE
	TRNN	F,F.BRF				;UNDER /BRIEF?
	 PUSHJ	P,.TCRLF			;YES,NO CRLF
	TYPEIT	< STATUS RETURNED: >
	;START [1352]
	CAILE	P1,1			;IF POSITIVE AND .GT.1 
	 JRST	NL%RT1			;HANDLE RETURN CODE FROM DNLOAD FOR IBM COMM
	IORI	P1,777400			;HW - -
	HRRES	P1,P1				;FW - NEG.
	MOVMS	P1,P1				;POS OFFSET
	MOVE	T1,NLLRES(P1)			;ADDR. OF REASON
	PJRST	.TSTRG

	;HERE HANDLE THE RETURN CODE FROM DNLOAD FOR IBM COMM
NL%RT1:	MOVE	T1,DN6RTN(P1)		;GET THE POINTER TO THE TEXT
	PJRST .TSTRG			;AND LIST IT THEN RETURN
	;END OF CODE FOR [1352], TABLE OF TEXT IS BELOW

NLLRES:	[ASCIZ/0-INVALID RETURN CODE/]
	[ASCIZ/-1. INVALID FUNCTION OR OPTION/]
	[ASCIZ/-2. INVALID MESSAGE FORMAT/]
	[ASCIZ/-3. INSUFFICIENT STATUS/]
	[ASCIZ/-4. INVALID RETURN CODE/]
	[ASCIZ/-5. INVALID RETURN CODE/]
	[ASCIZ/-6. INVALID RETURN CODE/]
	[ASCIZ/-7. INVALID RETURN CODE/]
	[ASCIZ/-8. INVALID LINE ID/]
	[ASCIZ/-9. LINE IN WRONG STATE/]
	[ASCIZ/-10. LINE COMMUNICATIONS ERROR/]
	[ASCIZ/-11. INVALID NODE ID/]
	[ASCIZ/-12. INVALID SERVER ID/]
	[ASCIZ/-13. INVALID FILE/]
	[ASCIZ/-14. CONFIGURATION DATA BASE ERROR/]
	[ASCIZ/-15. RESOURCE ERROR/]
	[ASCIZ/-16. INVALID PARAMETER VALUE/]
	[ASCIZ/-17. LINE PROTOCOL ERROR/]
	[ASCIZ\-18. FILE I/O ERROR\]
	[ASCIZ/-19. NETWORK COMM. ERROR/]
	[ASCIZ/-20. NO ROOM FOR NEW ENTRY/]
	[ASCIZ/-21. REMOTE NICE PROCESS NOT AVAIL./]


DN6RTN:[ASCIZ/0-INVALID RETURN CODE/]
	[ASCIZ/+1-SUCCESS/]
	[asciz\Illegal command to DNLOAD\]
	[asciz\Invalid device as target of load/dump\]
	[asciz\Incorrect command format\]
	[asciz\Failed to open KMC ucode file\]
	[asciz\BOOT JSYS error on KMC load\]
	[asciz\KMC load file has bad format\]
	[asciz\DLOAD a KMC is illegal\]
	[asciz\Bad device number\]
	[asciz\Unit number out of range\]
	[asciz\Failed to open secondary loader file\]
	[asciz\Invalid format for secondary loader file\]
	[asciz\Attempt to load secondary loader failed\]
	[asciz\Attempt to trigger the ROM failed\]
	[asciz\MOP reply from secondary loader failed\]
	[asciz\MOP reply from secondary loader bad\]
	[asciz\Bad file spec\]
	[asciz\Incorrect command format parsing LISTEN field\]
	[asciz\End of command expected\]
	[asciz\Specified device not a terminal\]
	[asciz\Unexpected error building a MOP message\]
	[asciz\Error transmitting MOP msg during tertiary or OPS load\]
	[asciz\Error receiving MOP msg during tertiary or OPS load\]
	[asciz\Wrong load number requested from loader during tertiary or OPS load\]
	[asciz\Failed to open tertiary loader file\]
	[asciz\Failed to open Operating System file\]
	[asciz\Bad transfer address\]
	[asciz\Not a valid extension for bootstrap file\]
	[asciz\Cannot open file for output\]
	[asciz\Error reading load file\]
	[asciz\Dump program dis not respond correctly after load\]
	[asciz\Secondary bootstrap loader/dumper too long\]
	[asciz\Error transmitting MOP msg during transfer of dump data\]
	[asciz\Expected dump record did not arrive from the FE\]
	[asciz\Dump data record from FE incorrect\]
	[asciz\Error writing dump file\]
	[asciz\Cannot initialize DDCMP on line to FE\]
	[asciz\Error flushing DDCMP buffers\]
	[asciz\Program request for unidentified program received from loader\]
	[asciz\Could not assign listening terminal line\]
	[asciz\Could not terminate protocol, continuing...\]
	[asciz\Wheel or Operator priveleges must be enabled\]
;ROUTINE NL$PST
;TYPES OUT THE PROGRAM NAME STRING
;TAKES NL%PGM IN P2
;ONLY NEEDED FOR TOPS10

NL$PST:	SKIPE	TOPMON		;RUNNING UNDER TOPS10?
	POPJ	P,0		;NO I WONT DO THIS
	TRNN	F,F.BRF		;BRIEF?
	PUSHJ	P,.TCRLF	;NO, I NEED A <CRLF>
	TRNN	F,F.BRF		;BRIEF?
	PUSHJ	P,.TTABC	;NO, I NEED A TAB
	TYPEIT	< WITH >	
	HRRZ	T1,P2		;GET STRING PTR
	ADDI	T1,WKBUFF	;MAKE IT A REAL PTR
	PUSHJ	P,.TSTRG	;TYPE IT OUT
	TRNN	F,F.BRF		;BRIEF?
	PUSHJ	P,.TCRLF	;NO, I NEED A <CRLF>
	POPJ	P,0		;DONE
	;NETHDR - LISTS HEADER TYPE INFO FOR MOST NETWORK ENTRIES -
	;	HARDWARE ERRORS,SOFTWARE ERRORS, TOPOLOGY CHANGES,
	;	LINE STATISTICS, NODE STATISTICS, AND NETWORK OPR
	;	ENTRIES.
	;CALLED WITH NH%MID IN P2

NETHDR:	SKIPN	P2		;NODE #'S PRESENT?
	 JRST	NETH01		;NO-TRY NAMES
	CAMN	P2,[-1]		;NULL VALUES?
	 JRST	NETH01		;YES-TRY NAMES
	TYPEIT	<
	TRANS. NODE #:  >
	HLRZ	T1,P2		;GET THE NUMBER
	PUSHJ	P,.ODECW	;WITH A PERIOD
	TYPEIT	<  DEST. NODE #:  >
	HRRZ	T1,P2
	PUSHJ	P,.ODECW
;HERE FOR NODE NAMES-XMIT FIRST
NETH01:	SKIPN	P2,WKBUFF+NH%XID 	;GET XMIT NODE NAME
	 JRST	NETH02			;NOT THERE
	CAMN	P2,[-1]			;UNKNOWN?
	 JRST	NETH02
	TYPEIT	<
	MSG SENT FROM:  >
	HRRZ	T1,P2
	ADDI	T1,WKBUFF
	PUSHJ	P,.TSTRG
;NOW FOR REC'D NAME
NETH02:	SKIPN	P2,WKBUFF+NH%RID 	;GET REC NODE NAME
	 JRST	NETH03			;NOT THERE
	CAMN	P2,[-1]			;UNKNOWN?
	 JRST	NETH03
	TYPEIT	<
	MSG REC'D AT:  >
	HRRZ	T1,P2
	ADDI	T1,WKBUFF
	PUSHJ	P,.TSTRG
;HERE FOR ADJACENT NODE NAME IF ANY
NETH03:	SKIPN	P2,WKBUFF+NH%ADN 	;GET ADJACENT NODE NAME
	 JRST	NETH04			;NOT THERE
	CAMN	P2,[-1]			;UNKNOWN?
	 JRST	NETH04
	TYPEIT	<
	NODE AT END OF SUBJECT LINE:  >
	HRRZ	T1,P2
	ADDI	T1,WKBUFF
	PUSHJ	P,.TSTRG
;HERE LIST HARDWARE & SOFTWARE TYPES ETC.
NETH04:	SKIPN	P2,WKBUFF+NH%FUN	;GET VALUES
	 JRST	NETH07			;NOT THERE?
	TYPEIT	<
	HDWR TYPE: >
	LDB	P1,[POINT ^D8,P2,35]
	CAIN	P1,377			;KNOWN?
	 JRST	[TYPEIT < UNKN >
		 JRST NETH05]
	CAILE	P1,HDWMAX		;[743]MAX I KNOW ABOUT
	 JRST	[TYPEIT <UNKN TO SYSERR >
		  JRST NETH05]
	CAIL	P1,CUSVAL		;CUSTOMER?-MAKE CHANGES HERE IF WANTED
	 JRST	[TYPEIT < CUST. >
		 JRST NETH05]
	MOVE	T1,HDWTYP(P1)		;IN RANGE NOW LIST A NAME
	PUSHJ	P,.TSTRG
;HERE DO SAME FOR SOFTWARE TYPE
NETH05:	SKIPN	P2,WKBUFF+NH%FUN	;GET VALUES
	 JRST	NETH07			;NOT THERE?
	TYPEIT	<  SOFTWARE TYPE: >
	LDB	P1,[POINT ^D8,P2,27]
	CAIN	P1,377			;KNOWN?
	 JRST	[TYPEIT < UNKN >
		 JRST NETH06]
	CAILE	P1,SOFMAX		;[743]MAX I KNOW ABOUT
	 JRST	[TYPEIT <UNKN TO SYSERR >
		  JRST NETH06]
	CAIL	P1,CUSVAL		;CUSTOMER?-MAKE CHANGES HERE IF WANTED
	 JRST	[TYPEIT < CUST. >
		 JRST NETH06]
	MOVE	T1,SOFTYP(P1)		;IN RANGE NOW LIST A NAME
	PUSHJ	P,.TSTRG
;HERE LIST PARENT SYSTEM TYPE
NETH06:	SKIPN	P2,WKBUFF+NH%FUN	;GET VALUES
	 JRST	NETH07			;NOT THERE?
	TYPEIT	<
	 PARENT SYSTEM TYPE: >
	LDB	P1,[POINT ^D8,P2,17]
	CAIN	P1,377			;KNOWN?
	 JRST	[TYPEIT < UNKN >
		 JRST NETH07]
	CAILE	P1,SYSMAX		;[743]MAX I KNOW ABOUT
	 JRST	[TYPEIT <UNKN TO SYSERR >
		  JRST NETH07]
	CAIL	P1,CUSVAL		;CUSTOMER?-MAKE CHANGES HERE IF WANTED
	 JRST	[TYPEIT < CUST. >
		 JRST NETH07]
	MOVE	T1,SYSTYP(P1)		;IN RANGE NOW LIST A NAME
	PUSHJ	P,.TSTRG


;HERE LIST MSG SEQUENCE NUMBER
NETH07:	SKIPN	P2,WKBUFF+NH%SEQ	;SHOULD BE THERE BUT?
	 JRST NETH08			;THAT'S WEIRD
	CAMN	P2,[-1]			;ALSO WEIRD
	 JRST NETH08
	MOVE	T2,ERTYPE		;WHICH TYPE ENTRY
	CAIN	T2,SEC%NH
	 MOVEI	T1,[ASCIZ/ HARDWARE ERROR /]
	CAIN	T2,SEC%SN
	 MOVEI	T1,[ASCIZ/ SOFTWARE ERROR /]
	CAIN	T2,SEC%NO
	 MOVEI	T1,[ASCIZ/ OPERATOR LOG /]
	CAIN	T2,SEC%NT
	 MOVEI	T1,[ASCIZ/ TOPOLOGY CHANGE /]
	CAIN 	T2,SEC%LC
	 MOVEI	T1,[ASCIZ/ LINE STATISTICS /]
	CAIN	T2,SEC%NC
	 MOVEI	T1,[ASCIZ/ NODE STATISTICS /]
	SKIPN	T1			;IF STILL
	 MOVEI	T1,[ASCIZ/ UNKNOWN /]
	PUSH	P,T1
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC		;NEXT LINE WITH A TAB
	POP	P,T1			;GET T1 BACK
	PUSHJ	P,.TSTRG		;SAY WHICH
	TYPEIT	<MSG SEQUENCE # FROM XMIT NODE: >
	MOVE	T1,P2			;SETUP
	PUSHJ	P,.ODECW		;WITH A PERIOD

;NOW LIST NODE'S UPTIME
NETH08:	SKIPN	P2,WKBUFF+NH%DAT	;GET UPTIME IN MILLISEC'S
	 JRST	NETH09			;NOT THERE?
	CAMN	P2,[-1]			;UNKNOWN?
	 JRST	NETH09
	TYPEIT	<
	NODE'S UPTIME AT EVENT:  >
	IMULI	P2,^D1000		;CONVERT TO SECONDS
	IDIVI	P2,^D24*^D60*^D60	;# DAYS(COULD BE A MIRACLE)
	SKIPE	P2			;ANY THERE?
	 PUSHJ	P,[MOVE	T1,P2		;MOVE #
		 PUSHJ	P,.ODECW	;WITH A .
		 TYPEIT  < DAYS, >
		 POPJ	P,0]
	MOVE	P2,P3			;GET REMAINDER
	IDIVI	P2,^D60*^D60		;HOURS
	MOVE	T1,P2
	PUSHJ	P,.TDECW
	PUSHJ	P,.TCOLN
	MOVE	P2,P3
	IDIVI	P2,^D60			;NOW MINUTES
	MOVE	T1,P2
	PUSHJ	P,.TDECW
	PUSHJ	P,.TCOLN
	MOVE	T1,P3			;REMAINDER IS SECONDS
	PUSHJ	P,.TDECW
	PUSHJ	P,.TCRLF

;HERE LIST THE LINE ID

NETH09:	SKIPN	P2,WKBUFF+NH%FUN	;GET HDWR TYPE BACK
	 POPJ	P,0			;NOT THERE?
	CAMN	P2,[-1]			;VALID?
	 POPJ	P,0
	TYPEIT	<
	LINE ID:  >
	PUSHJ	P,NETLID
NETH10:	PUSHJ	P,.TCRLF
	POPJ	P,0			;NOW RETURN


	;NETLID-LISTS LINE ID
	;P2/NH%FUN
	;CALL PUSHJ  RETURNS POPJ

NETLID:	LDB	P1,[POINT ^D8,P2,35]	;GET THE TYPE
	CAIN	P1,377			;KNOWN?
	 JRST	[TYPEIT < UNKN >
		 JRST NETH10]
	CAILE	P1,HDWMAX		;[743]MAX I KNOW ABOUT
	 JRST	[TYPEIT <UNKN TO SYSERR >
		  JRST NETH10]
	CAIL	P1,CUSVAL		;CUSTOMER?-MAKE CHANGES HERE IF WANTED
	 JRST	[TYPEIT < CUST. >
		 JRST NETH10]
	MOVE	T1,LINTYP(P1)		;IN RANGE NOW LIST A NAME
	PUSHJ	P,.TSIXN		;A WORD IN SIXBIT
	TYPEIT	<_>			;THE SEPARATOR
	HLRZ	T1,WKBUFF+NH%LID	;GET CONTROLLER #
	PUSHJ	P,.TOCTW		;LIST IN OCTAL
	HRRZ	P2,WKBUFF+NH%LID	;GET LINE #
	CAIN	P2,-1			;IF VALID
	 POPJ	P,0			;NO RETURN NOW
	TYPEIT	<_>
	MOVE T1,P2
	PUSHJ	P,.TOCTW
	TYPEIT	<_>
	HRRZ	T1,WKBUFF+NH%LI1	;[743]GET STATION #
	CAIN	T1,-1		;WAS IT SUPPLIED?
	 MOVEI	T1,0		;NO, SAY IT'S ZERO
	PUSHJ	P,.TOCTW
	POPJ	P,0
	;HERE ARE THE NAMES WE UNDERSTAND FOR THE FIELDS DESCRIBED
	;IN NH%FUN

	CUSVAL==301	;VALUES GREATER THAN THIS ARE FOR CUSTOMER USE

HDWTYP:	[ASCIZ/ILLEGAL/]
	[ASCIZ/ SOFTWARE/]
	[ASCIZ/ DQ11/]
	[ASCIZ/ KMC-DUP11/]
	[ASCIZ/ KMC-DZ11/]
	[ASCIZ/ DMC11/]
	[ASCIZ/ LP20/]
	[ASCIZ/ CD20/]
	[ASCIZ/ DH11/]
	[ASCIZ/ DZ11/]
	[ASCIZ/ DM11-BB/]
	[ASCIZ/ DL11/]
	[ASCIZ/ KG11/]
	[ASCIZ/ DTE-20/]
	[ASCIZ/ LP11/]
	[ASCIZ/ CR11/]
	[ASCIZ/ VT62/]
	[ASCIZ/ RX11/]
	[ASCIZ/ DP8E/]
	[ASCIZ/ KL8A/]
	[ASCIZ/ LP08/]
	[ASCIZ/ CR08/]
	[ASCIZ/ 11-MEMORY/]
	[ASCIZ/ DUP11/]
	
HDWMAX==27	;MAX NAMES WE KNOW IN THE ABOVE LIST

SOFTYP:	[ASCIZ/ ILLEGAL/]
	[ASCIZ/ RT-11/]
	[ASCIZ/ RSTS-E/]
	[ASCIZ/ RSX-11S/]
	[ASCIZ/ RSX-11M/]
	[ASCIZ/ RSX-11D/]
	[ASCIZ/ IAS/]
	[ASCIZ/ VAX-VMS/]
	[ASCIZ/ TOPS-20/]
	[ASCIZ/ TOPS-10/]
	[ASCIZ/ RTS-8/]
	[ASCIZ/ OS-8/]
	[ASCIZ/ RSX-11M+/]
	[ASCIZ/ DN60/]
	[ASCIZ/ DECnet INTERCEPT-MCB/]
	[ASCIZ/ DN8x/]
	[ASCIZ/ DN92/]
	[ASCIZ/ RSX-20F/]
	[ASCIZ/ DECnet NON-INTERCEPT/]

SOFMAX==22	;SAME FOR SOFTWARE TYPES

SYSTYP:	[ASCIZ/ ILLEGAL/]
	[ASCIZ/ DN20/]
	[ASCIZ/ DN200/]
	[ASCIZ/ DN87S/]
	[ASCIZ/ DN85/]
	[ASCIZ/ DN80,1,2/]
	[ASCIZ/ KI10/]
	[ASCIZ/ KL10/]
	[ASCIZ/ KS10/]
	[ASCIZ/ DN92/]

SYSMAX==12	;SAME FOR PARENT SYSTEM TYPES



;HERE BUILD A TABLE OF SIXBIT LINE NAMES FOR LISTING LINE ID:

LINTYP:	SIXBIT/ILL/
	SIXBIT/SOFT/	;SOFTWARE
	SIXBIT/DQ/	;DQ11
	SIXBIT/KDP/	;KMC-DUP11
	SIXBIT/KDZ/	;KMC-DZ11
	SIXBIT/DMC/	;DMC11
	SIXBIT/LP20/	;LP20
	SIXBIT/CD20/	;CD20
	SIXBIT/DH/	;DH11
	SIXBIT/DZ/	;DZ11
	SIXBIT/DM/	;DM11-BB
	SIXBIT/DL/	;DL11
	SIXBIT/KG/	;KG11
	SIXBIT/DTE/	;DTE-20
	SIXBIT/LP11/	;LP11
	SIXBIT/CR11/	;CR11
	SIXBIT/VT62/	;VT62
	SIXBIT/RX11/	;RX11
	SIXBIT/DP8E/	;DP8E
	SIXBIT/KL8A/	;KL8A
	SIXBIT/LP08/	;LP08
	SIXBIT/CR08/	;CR08
	SIXBIT/11-MEM/	;'11 MEMORY
	SIXBIT/DUP/	;DUP11
;HERE START THE ROUTINES FOR NETWORK HARDWARE ENTRIES
;P2 HAS NH%RSM

NETHDW:	TYPEIT	<
	REASON FOR ENTRY:	>
	HRRZ	T2,P2		;GET REASON #
	;[1213]
	CAIN	T2,-1		;OTHER VALUE FOR 'NOT SUPPLIED'?
	 MOVEI	T2,0		;YES
	CAILE	T2,RSMMAX	;IN RANGE?
	 JRST	[MOVE  T1,T2
		PUSHJ	P,.TOCTW
		PUSHJ	P,.TCOMA
		MOVEI	T1,[ASCIZ/ UNKN TO SYSERR /]
		JRST	NETHD1
		]
	;END[1213]
	MOVE 	T1,ASZRSM(T2)	;IN ASCIZ
NETHD1:	PUSHJ	P,.TSTRG
	HRRZ	T1,P2
	CAIN	T1,10		;REASON TO LIST THRESHOLD?
	 PUSHJ 	P,[ TYPEIT (THRESHOLD = )
		  HLRZ	T1,P2		;GET THE THRESHOLD
		  PUSHJ	P,.TOCTW	;IN OCTAL
		  POPJ	P,0]
;NOW FOR RETRY ETC

	TYPEIT	<
	RECOVERY STATE:	>
	MOVE	P2,WKBUFF+NH%TRY	;GET THE WORD TO DECODE
	LDB	T2,[POINT 4,P2,3]	;GET THE FLAGS
	;[1213]
	CAIN	T2,17			;OTHER VALUE FOR 'NOT SUPPLIED'?
	 MOVEI	T2,0			;YES
	CAILE	T2,RECMAX		;IN RANGE?
	 JRST	[MOVEI	T1,[ASCIZ/ UNKN TO SYSERR /]
		JRST	NETHD2
		]
	;END [1213]
	MOVE	T1,RECOV(T2)		;ASCIZ ADDR
NETHD2:	PUSHJ	P,.TSTRG
	HRRZ	T1,P2
	CAIN	T1,-1			;VALUE SUPPLIED?
	 JRST	NETHD3			;NO
	PUSH	P,T1			;SAVE IT
	TYPEIT	< COUNT: >
	POP	P,T1			;RESTORE IT
	PUSHJ	P,.ODECW		;WITH A .


;HERE A BRIEF DESCRIPTION OF THE ERROR DETECTED

NETHD3:	TYPEIT	<
	ERROR:	>
	LDB 	P1,[POINT 8,WKBUFF+NH%FUN,35]	;GET HDWR TYPE
	MOVE	P2,WKBUFF+NH%PTR	;GIVE SUBROUTINE A PNTR TO DATA SECTION
	PUSHJ	P,@HDWERR(P1)		;GET SOME BRIEF ERROR TEXT
	;NO MORE INFO IF NOT DETAIL
	;[1214]
	SETZM	P1		;CLEAR THE ARGUEMENT
	;END[1214]
	PUSHJ	P,DETCHK
	TYPEIT	<
HARDWARE REGISTER INFORMATION:
>					;START WITH A FRESH LINE
	MOVE	P1,WKBUFF+NH%PTR	;POINTER TO DATA AREA
	ADDI	P1,WKBUFF		;FINISH THE POINTER
	LDB	T2,[POINT 8,WKBUFF+NH%FUN,35]	;HDWR TYPE
	PUSHJ	P,@HDWCTL(T2)		;GO DO SOME WORK
	POPJ	P,0			;RETURN TO PROCSN

	;[1214] DO A BRIEF XLATION OF THE ERROR FOR THE BRIEF
	;PROCESSOR
NETBRF:	HRRZ	T2,P2		;GET REASON #
	;[1213]
	CAIN	T2,-1		;OTHER VALUE FOR 'NOT SUPPLIED'?
	 MOVEI	T2,0		;YES
	CAILE	T2,RSMMAX	;IN RANGE?
	 JRST	[MOVEI	T1,[ASCIZ/ UNKN TO SYSERR /]
		PJRST	.TSTRG	;[1246]
		]
	;END[1213]
	MOVE 	T1,ASZRSM(T2)	;IN ASCIZ
	PUSHJ	P,.TSTRG
	POPJ	P,0
	;END [1214]
;HERE ARE ASCIZ TABLES FOR ABOVE CODE
;MORE ADDED WITH [1213] FROM HOFFMAN'S FUNCTIONAL SPEC OF 8-JAN-79
ASZRSM:	[ASCIZ/ILLEGAL/]
	[ASCIZ/UNDEFINED REASON/]
	[ASCIZ/NXM/]
	[ASCIZ/LOST INTERRUPT ENABLE/]
	[ASCIZ/UNEXPECTED INTERRUPT/]
	[ASCIZ/UNEXPECTED DATA SET STATUS CHANGE/]
	[ASCIZ/DEVICE TIMEOUT/]
	[ASCIZ/POWER FAIL/]
	[ASCIZ/POWER RESTART/]
	[ASCIZ/THRESHOLD VALUE EXCEEDED/]
	[ASCIZ/OVERRUN/]
	[ASCIZ/LOST DATA-MSG TOO LONG FOR BUFFER/]
	[ASCIZ/MAINT. MSG REC'D DURING NORMAL OPERATION/]
	[ASCIZ/DDCMP START REC'D DURING NORMAL OPERATION/]
	[ASCIZ/DDCMP HDR. FORMAT ERROR/]
	[ASCIZ/SDLC OPERATION ABORTED/]
	[ASCIZ/PARITY ERROR ON TRANSMISSION BUS/]
	[ASCIZ/PARITY ERROR IN MEMORY/]
	[ASCIZ/PARITY ERROR IN TRANSMITTED CHAR./]
	[ASCIZ/CRC ERROR/]
	[ASCIZ/FRAMING ERROR/]
	[ASCIZ/PROCEDURE ERROR/]
	[ASCIZ/TRANSFER ERROR/]
	[ASCIZ/TRANSMITTER TIMEOUT/]	;;BEGIN EDIT [1251]
	[ASCIZ/SELECT ERROR/]
	[ASCIZ/RECEIVE ERROR THRESHOLD EXCEEDED/]
	[ASCIZ/NAK THRESHOLD EXCEEDED/]	;;END EDIT [1251]

	;[1213]
RSMMAX==^D26		;MAX KNOWN TO SYSERR **[1251] - CHANGE FROM 22 TO 26
	;END [1213]

RECOV:	[ASCIZ/NOT SUPPLIED, /]
	[ASCIZ/NON-RECOVERABLE, /]
	[ASCIZ/RECOVERY DISABLED, /]
	[ASCIZ/RECOV. ALGORITHM NOT AVAILABLE, /]
	[ASCIZ/RECOVERABLE, /]

	;[1213]
RECMAX==4		;MAX KNOWN TO SYSERR
	;END [1213]

HDWERR:	0,HDWUNK	;ILLEGAL 
	0,HDWUNK	; SOFTWARE 
	0,ERR002	; DQ11 
	0,ERR003	; KMC-DUP11 
	0,ERR004	; KMC-DZ11 
	0,ERR005	; DMC11 
	0,ERR006	; LP20 
	0,ERR007	; CD20 
	0,ERR010	; DH11 
	0,ERR011	; DZ11 
	0,HDWUNK	; DM11-BB 
	0,HDWUNK	; DL11 
	0,HDWUNK	; KG11 
	0,ERR015	; DTE-20 
	0,HDWUNK	; LP11 
	0,HDWUNK	; CR11 
	0,HDWUNK	; VT62 
	0,HDWUNK	; RX11 
	0,HDWUNK	; DP8E 
	0,HDWUNK	; KL8A 
	0,HDWUNK	; LP08 
	0,HDWUNK	; CR08 
	0,HDWUNK	; 11-MEMORY 
	0,ERR027	; DUP11 


HDWUNK: TYPEIT	<DEVICE UNKNOWN TO SYSERR>
	POPJ	P,0
;HERE IS TABLE OF ADDRESS OF LISTING ROUTINES.

HDWCTL:	0,HDWUNK	;ILLEGAL 
	0,HDWUNK	; SOFTWARE 
	0,LST002	; DQ11 
	0,LST003	; KMC-DUP11 
	0,LST004	; KMC-DZ11 
	0,LST005	; DMC11 
	0,LST006	; LP20 
	0,LST007	; CD20 
	0,LST010	; DH11 
	0,LST011	; DZ11 
	0,HDWUNK	; DM11-BB 
	0,HDWUNK	; DL11 
	0,HDWUNK	; KG11 
	0,LST015	; DTE-20 
	0,HDWUNK	; LP11 
	0,HDWUNK	; CR11 
	0,HDWUNK	; VT62 
	0,HDWUNK	; RX11 
	0,HDWUNK	; DP8E 
	0,HDWUNK	; KL8A 
	0,HDWUNK	; LP08 
	0,HDWUNK	; CR08 
	0,HDWUNK	; 11-MEMORY 
	0,LST027	; DUP11 
;HERE START THE DEVICE REGISTER LISTING CODE FOR THE NETWORK HARDWARE DEVICES.
;NAMES ARE LSTXXX, NAMXXX,AND CTLXXX WHERE XXX = THE DEVICE TYPE OFFSET.
;P1 HOLDS OFFSET (WKBUFF ADDED) TO THE START OF THE LOG DATA SECTION.
;SETUP FOR LSTEB IS
; P1/ -#BYTES,,ADDRESS TO FIRST
; P2/ ADDRESS OF NAMES TBL,, ADDRESS OF CTL TBL

;CTLXXX TBL HAS THE FORMAT  -1,,ADDRESS OF SPECIAL ROUTINE OR
; OFFSET FOR KONTYP,, 0 TO USE CNIDCD

;*%*%*%*%*%*%*%*
;SUPPORT FOR DQ11
;*%*%*%*%*%*%*%*

LST002:	HRLI	P1,-^D19		;NUMBER OF REGISTERS
	HRLI	P2,NAM002	;ADDRESS OF REG NAMES
	HRRI	P2,CTL002	;ADDRESS OF REG CTL TBL.
	PUSHJ	P,LSTEB		;DO THE LISTING
	POPJ	P,0		;BACK TO NETHDW

ERR002:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	HRLI	P1,-12		;SWAP 12 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	ADDI	P2,WKBUFF
	LDB	P1,[POINT 16,0(P2),15]
	MOVEI	T1,2
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD
	POPJ	P,0


NAM002:	SIXBIT/RXSTAT/
	SIXBIT/TXSTAT/
	SIXBIT/REGERR/
	SIXBIT/RXBAP/
	SIXBIT/RXCCP/
	SIXBIT/TXBAP/
	SIXBIT/TXCCP/
	SIXBIT/RXBAS/
	SIXBIT/RXCCS/
	SIXBIT/TXBAS/
	SIXBIT/TXCCS/
	SIXBIT/CHRDET/
	SIXBIT/SYNC/
	SIXBIT/MISC/
	SIXBIT/TXBUF/
	SIXBIT/SEQ/
	SIXBIT/RXBCC/
	SIXBIT/TXBCC/
	SIXBIT/RTPOLY/

CTL002:	-1,,NOTRAN
	-1,,NOTRAN
	2,,0	;DQ11-REGERR
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
;*%*%*%*%*%*%*%*
;SUPPORT FOR KMC-DUP11
;*%*%*%*%*%*%*%*

LST003:	PUSHJ	P,KMCLST	;GO DO CONTROLLER STUFF
	TYPEIT	<
	DEVICE REGISTERS:
>
	ADDI	P1,WKBUFF	;SETUP P1
	PUSHJ	P,LST027	;USE THAT CODE
	POPJ	P,0

ERR003:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	ADDI	P1,1		;ADJUST FOR PNTR TO SUB-BLOCK
	HRLI	P1,-2		;SWAP 2 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	PUSH	P,P2		;SAVE POINTER
	ADDI	P2,WKBUFF+2	;POINT AT SEL4&6
	LDB	T1,[POINT 16,0(P2),31]	;T1 GETS SEL6
	PUSHJ	P,SE6LST	;DO X-LATION IF CNTL OUT
	POP	P,P2		;RESTORE POINTER
	MOVE	P2,WKBUFF(P2)	;GET POINTER TO DUP REGISTERS
	PJRST	ERR027		;USE ERROR X-LATION FOR DUP
;*%*%*%*%*%*%*%*
;SUPPORT FOR KMC/DZ11
;*%*%*%*%*%*%*%*

LST004:	PUSHJ	P,KMCLST	;DO CONTROLLER STUFF
	TYPEIT	<
	DEVICE REGISTERS:
>
	ADDI	P1,WKBUFF
	PUSHJ	P,LST011	;USE THAT CODE
	POPJ	P,0

ERR004:	PUSH	P,P2		;SAVE POINTER
	ADDI	P2,WKBUFF+2	;POINT AT SEL4&6
	LDB	T1,[POINT 16,0(P2),31]	;T1 GETS SEL6
	PUSHJ	P,SE6LST	;DO X-LATION IF CNTL OUT
	POP	P,P2		;RESTORE POINTER
	MOVE	P2,WKBUFF(P2)	;GET POINTER TO DZ REGISTERS
	PJRST	ERR011
;*%*%*%*%*%*%*%*
;SUPPORT FOR DMC11
;*%*%*%*%*%*%*%*

LST005:	PUSHJ	P,KMCLST	;DO CONTROLLER STUFF
	;[1214] NO VALUES CURRENTLY SUPPLIED FOR DMC LINE UNITS
	;SO DON'T LIST ALL ZEROS, THEY'RE MISLEADING
	POPJ	P,0
	TYPEIT	<
	DEVICE REGISTERS:
>
	;END [1214]
	ADDI	P1,WKBUFF
	HRLI	P1,-^D9
	HRLI	P2,NAM005
	HRRI	P2,CTL005
	PUSHJ	P,LSTEB
	POPJ	P,0		;BACK TO NETHDW

ERR005:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	ADDI	P1,1		;ADJUST FOR PNTR TO SUB-BLOCK
	HRLI	P1,-2		;SWAP 2 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	PUSH	P,P2		;SAVE POINTER
	ADDI	P2,WKBUFF+2	;POINT AT SEL4&6
	LDB	T1,[POINT 16,0(P2),31]	;T1 GETS SEL6
	PUSHJ	P,SE6LST	;DO X-LATION IF CNTL OUT
	POP	P,P2		;RESTORE POINTER
	MOVE	P2,WKBUFF(P2)	;GET POINTER TO DMC LINE UNIT REGISTERS
	POPJ	P,0	;*%*% FOR NOW


NAM005:	SIXBIT/UNIT S/	;LINE UNIT STATUS CODE
	SIXBIT/I-DATS/	;IN DATA SILO
	SIXBIT/O-DATC/	;OUT DATA CONTROL
	SIXBIT/I-DATC/	;IN DATA CONTROL
	SIXBIT/M-CONT/	;MODEM CONTROL REG
	SIXBIT/SYNC  /	;SYNC
	SIXBIT/REG 15/	;REG 15
	SIXBIT/REG 16/	;REG 16
	SIXBIT/MAINT /	;MAINTENANCE REG-17


CTL005:	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
;*%*%*%*%*%*%*%*
;SUPPORT FOR LP20
;*%*%*%*%*%*%*%*
LST006:	HRLI	P1,-^D6		;NUMBER OF REGISTERS
	HRLI	P2,NAM006	;ADDRESS OF REG NAMES
	HRRI	P2,CTL006	;ADDRESS OF REG CTL TBL.
	PUSHJ	P,LSTEB		;DO THE LISTING
	POPJ	P,0		;BACK TO NETHDW
ERR006:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	HRLI	P1,-3		;SWAP 3 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	POPJ	P,0		;*/*/*FOR NOW


NAM006:	SIXBIT/LPCSRA/
	SIXBIT/LPCSRB/
	SIXBIT/LPBSAD/
	SIXBIT/LPBCTR/
	SIXBIT/LPPCTR/
	SIXBIT/LPTDAT/

CTL006:	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
;*%*%*%*%*%*%*%*
;SUPPORT FOR CD20
;*%*%*%*%*%*%*%*
LST007:	HRLI	P1,-^D5		;NUMBER OF REGISTERS
	HRLI	P2,NAM007	;ADDRESS OF REG NAMES
	HRRI	P2,CTL007	;ADDRESS OF REG CTL TBL.
	PUSHJ	P,LSTEB		;DO THE LISTING
	POPJ	P,0		;BACK TO NETHDW

ERR007:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	HRLI	P1,-3		;SWAP 3 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	POPJ	P,0		;FOR NOW

NAM007:	SIXBIT/CDST  /
	SIXBIT/CDCC  /
	SIXBIT/CDBA  /
	SIXBIT/CDDB  /
	SIXBIT/SOFT S/


CTL007:	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
;*%*%*%*%*%*%*%*
;SUPPORT FOR DH11
;*%*%*%*%*%*%*%*

LST010:	HRLI	P1,-^D7		;NUMBER OF REGISTERS
	HRLI	P2,NAM010	;ADDRESS OF REG NAMES
	HRRI	P2,CTL010	;ADDRESS OF REG CTL TBL.
	PUSHJ	P,LSTEB		;DO THE LISTING
	POPJ	P,0		;BACK TO NETHDW

ERR010:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	HRLI	P1,-4		;SWAP 4 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	POPJ	P,0		;FOR NOW


NAM010:	SIXBIT/CONT R/
	SIXBIT/N R CH/
	SIXBIT/C ADDR/
	SIXBIT/B CNT /
	SIXBIT/BUFACT/
	SIXBIT/DM11CS/
	SIXBIT/DM11LS/


CTL010:	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
;*%*%*%*%*%*%*%*
;SUPPORT FOR DZ11
;*%*%*%*%*%*%*%*

LST011:	HRLI	P1,-^D4		;NUMBER OF REGISTERS
	HRLI	P2,NAM011	;ADDRESS OF REG NAMES
	HRRI	P2,CTL011	;ADDRESS OF REG CTL TBL.
	PUSHJ	P,LSTEB		;DO THE LISTING
	POPJ	P,0		;BACK TO NETHDW


ERR011:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	HRLI	P1,-2		;SWAP 2 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	ADDI	P2,WKBUFF	;FIX POINTER
	LDB	P1,[POINT 16,0(P2),15]	;GET CSR WORD
	MOVEI	T1,5		;OFFSET TO
	MOVEM	T1,KONTYP	;SETUP FOR CNIDCD
	PUSHJ	P,CNIDCD	;DO X-LATION
	TYPEIT	< IN DZ11-CSR >
	POPJ	P,0


NAM011:	SIXBIT/CSR/
	SIXBIT/RBUF/
	SIXBIT/TCR/
	SIXBIT/MSR/


CTL011:	5,,0
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
;*%*%*%*%*%*%*%*
;SUPPORT FOR KMC/DMC CONTROLLERS
;*%*%*%*%*%*%*%*

KMCLST:	TYPEIT	<	MICROCODE:	>
	MOVE	P2,P1	
	ADDI	P2,3		;POINT AT U CODE ID
	LDB	T3,[POINT 16,0(P2),15]
	MOVE	T1,KMCNAM(T3)	;ASCIZ NAME
	PUSH	P,T3		;SAVE TYPE
	PUSHJ	P,.TSTRG
	POP	P,T1		;GET ID TYPE BACK
	CAIN	T1,2		;DN60-DO VERSION NUMBERS
	 PUSHJ	P,KMCVER	;DO IT
	TYPEIT	<
	CONTROLLER REGISTERS:
>
	MOVE	P2,0(P1)	;GET PNTR TO SUBTABLE
	PUSH	P,P2		;SAVE IT
	ADDI	P1,1		;ADJUST FOR PNTR JUST SAVED
	HRLI	P1,-^D4		;4ITEMS TO LIST
	HRLI	P2,NAMKMC	
	HRRI	P2,CTLKMC
	PUSHJ	P,LSTEB
	POP	P,P1
	POPJ	P,0

KMCNAM:	[ASCIZ/NOT SUPPLIED/]
	[ASCIZ/COMM-IOP/]
	[ASCIZ/DN60/]
	[ASCIZ/TOPS10-DZ11/]
	[ASCIZ/TOPS10-DUP11/]

NAMKMC:	SIXBIT/SEL 0/
	SIXBIT/SEL 2/
	SIXBIT/SEL 4/
	SIXBIT/SEL 6/

CTLKMC:	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,SE6LST


KMCVER:	PUSH	P,P2
	TYPEIT	<
	MICRO CODE VERSION:	>
	LDB	T1,[POINT 16,0(P2),31]
	LDB	T2,[POINT 16,1(P2),15]	;GET MINOR
	LDB	T3,[POINT 16,1(P2),31]	;EDIT
	LDB	T4,[POINT 16,2(P2),15]	;WHO
	DPB	T1,[POINT 9,P2,11]	;MAJOR
	DPB	T2,[POINT 6,P2,17]	;MINOR
	DPB	T3,[POINT 18,P2,35]	;EDIT
	DPB	T4,[POINT 3,P2,2]	;WHO
	MOVE	T1,P2			;SETUP
	PUSHJ	P,.TVERW##		;GO LIST IT
	POP	P,P2			;RESTORE IT
	POPJ	P,0

	;HERE TO TRANSLATE CONTENTS OF SEL6 IF SEL2 INDICATES
	;A CONTROL OUT FUNCTION.  T1 HOLDS SEL6

SE6LST:	MOVE	T2,WKBUFF+NH%PTR	;POINTER TO LOG DATA
	ADDI	T2,WKBUFF+1		;+1 TO POINT AT SEL0&2
	LDB	T3,[POINT 2,0(T2),31]	;GET BITS 0&1 OF SEL2
	CAIE	T3,1			;IF NOT CONTROL OUT, DON'T LIST
	 POPJ	P,0			;X-LATION OF SEL6.
	MOVE 	P1,T1			;WORD TO X-LATE
	MOVEI	T1,6			;OFFSET(WITHIN SYSERN) FOR KONTYP
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD		;DO X-LATION
	TYPEIT	< IN SEL6,>
	POPJ	P,0			;RETURN
;*%*%*%*%*%*%*%*
;SUPPORT FOR DTE-20
;*%*%*%*%*%*%*%*


LST015:	HRLI	P1,-^D16		;NUMBER OF REGISTERS
	HRLI	P2,NAM015	;ADDRESS OF REG NAMES
	HRRI	P2,CTL015	;ADDRESS OF REG CTL TBL.
	PUSHJ	P,LSTEB		;DO THE LISTING
	POPJ	P,0		;BACK TO NETHDW

ERR015:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	HRLI	P1,-10		;SWAP 10 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	POPJ	P,0

NAM015:	SIXBIT/DLYCNT/
	SIXBIT/DEXWD3/
	SIXBIT/DEXWD2/
	SIXBIT/DEXWD1/
	SIXBIT/TENAD1/
	SIXBIT/TENAD2/
	SIXBIT/TO10BC/
	SIXBIT/TO11BC/
	SIXBIT/TO10AD/
	SIXBIT/TO11AD/
	SIXBIT/TO10DT/
	SIXBIT/TO11DT/
	SIXBIT/DIAG 1/
	SIXBIT/DIAG 2/
	SIXBIT/SREG  /
	SIXBIT/DIAG 3/

CTL015:	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
	-1,,NOTRAN
;*%*%*%*%*%*%*%*
;SUPPORT FOR DUP11 NOT UNDER KMC
;*%*%*%*%*%*%*%*

LST027:	HRLI	P1,-^D4		;NUMBER OF REGISTERS
	HRLI	P2,NAM027	;ADDRESS OF REG NAMES
	HRRI	P2,CTL027	;ADDRESS OF REG CTL TBL.
	PUSHJ	P,LSTEB		;DO THE LISTING
	POPJ	P,0		;BACK TO NETHDW

ERR027:	HRRZ	P1,P2		;OFFSET TO 1ST WORD TO SWAP
	HRLI	P1,-2		;SWAP 2 WORDS
	PUSHJ	P,SWPBYT	;DO THE SWAP
	ADDI	P2,WKBUFF
	LDB	P1,[POINT 16,0(P2),15]
	MOVEI	T1,3
	MOVEM	T1,KONTYP
	PUSHJ	P,CNIDCD
	TYPEIT	< IN RxDBUF, >
	LDB	P1,[POINT 16,0(P2),31]
	AOS	KONTYP	;HERE'S ANOTHER ONE, PAUL
	PUSHJ	P,CNIDCD
	TYPEIT	< IN TxCSR>
	POPJ	P,0

NAM027:	SIXBIT/RXCSR/
	SIXBIT/RXDBUF/
	SIXBIT/TXCSR/
	SIXBIT/TXDBUF/

CTL027:	-1,,NOTRAN
	3,,0		;DUP11-RXDBUF
	4,,0		;DUP11-TXCSR
	-1,,NOTRAN
	;HERE ARE SOME UTILITY ROUTINES FOR NETWORK EVENT LOGGING

	;SWPBYT - SWAPS HI & LO ORDER BYTES IN DEVICE REGISTERS TO
	;GET THEM BACK IN PROPER ORDER
	;CALL PUSHJ WITH
	;P1/ -#OF FULL WORDS TO TRANSLATE,, OFFSET FROM WKBUFF TO 1ST

SWPBYT:	ADDI	P1,WKBUFF		;FIX UP POINTER
SWPBY1:	LDB	T1,[POINT 8,(P1),7]	;1ST LOW BYTE
	LDB	T2,[POINT 8,(P1),15]	;1ST HI BYTE
	DPB	T2,[POINT 8,T1,27]	;SWAPPED IN T1
	DPB	T1,[POINT 16,(P1),15]	;RETURNED INTO WKBUFF
	LDB	T1,[POINT 8,(P1),23]	;2ND LOW BYTE
	LDB	T2,[POINT 8,(P1),31]	;2ND HI BYTE
	DPB	T2,[POINT 8,T1,27]	;SWAPPED IN T1
	DPB	T1,[POINT 16,(P1),31]	;RETURNED INTO WKBUFF
	AOBJN	P1,SWPBY1		;MORE TO DO?
	POPJ	P,0			;NO-ALL DONE.
;HERE START THE LISTING ROUTINES FOR DN64 STATISTICS, P2 HOLDS
;FIRST WORD OF ENTRY.
;*****
;*****USED PRIOR TO TOPS-20 RELEASE 4 ONLY
;*****

S6%LST:	TYPEIT	<
	REASON FOR ENTRY:  >
	CAIN	P2,1		;STARTUP?
	PUSHJ	P,S6%LSA
	CAIN	P2,2	;HOUR SINCE LAST ENTRY
	PUSHJ	P,S6%LSB
	CAIN P2,3	;SHUTDOWN?
	PUSHJ	P,S6%LSC
	CAILE	P2,3	;UNKNOWN?
	PUSHJ	P,S6%LSD
	MOVE 	P2,WKBUFF+S6%001	;GET NEXT 4 BYTES (4-7)[723]
	PUSHJ	P,S6%LNT		;GO LIST THEM[723]
	MOVE 	P1,WKBUFF+S6%S00	;GET FIRST 4 STATUS BYTES (8-11)
	TYPEIT	<		TERMINAL TYPE: >
	LDB	T2,[POINT 8,P1,15]
	MOVEI	T1,[ASCIZ/IBM 3780/]
	CAIE	T2,1			;BETTER CHECK
	 MOVEI	T1,[ASCIZ/IBM 2780/]	;OK, CHANGE IT
	PUSHJ	P,.TSTRG
	TYPEIT	<
	FLAGS: >
	LDB	P2,[POINT 8,P1,23]	;GET FLAG BYTE
	MOVEI	T1,[ASCIZ/SIMULATE,/]
	TRNN	P2,1B35			;CHECK BIT 0 OF BYTE
	 MOVEI	T1,[ASCIZ/SUPPORT,/]	;IF CLEAR,CHANGE
	PUSHJ	P,.TSTRG		;SAY EITHER
	MOVEI	T1,[ASCIZ/ PRIMARY BSC STATION/]
	TRNN	P2,1B34			;CHECK BIT 1 OF BYTE
	 MOVEI	T1,[ASCIZ/ SECONDARY BSC STATION/]	;IF CLEAR,CHANGE
	PUSHJ	P,.TSTRG
	TYPEIT	<
	LINE INFORMATION:  >
	LDB	P2,[POINT 8,P1,31]	;P1 STILL HAS S6%S00
	MOVEI	T1,[ASCIZ/ ENABLED,/]	;SETUP
	TRNE	P2,1B35			;IF NOT SET
	 PUSHJ	P,.TSTRG		;DON'T LIST
	MOVEI	T1,[ASCIZ/ DTR,/]
	TRNE	P2,1B34
	 PUSHJ	P,.TSTRG
	MOVEI	T1,[ASCIZ/ DSR/]
	TRNE	P2,1B33
	 PUSHJ	P,.TSTRG
	TYPEIT	<
	COUNT OF LINE DRIVER ERROR INTERRUPTS: >
	;SETUP POINTERS ETC TO LIST LINE STATUS AND COUNTERS
	SETZM	P3		;COUNT OF ITEMS LISTED
	MOVE	P4,[POINT 8,WKBUFF+S6%S01,7]	;INITIAL BYTE POINTER
	LDB	T1,P4		;GET FIRST ITEM
	ILDB	T2,P4		;GET HI BYTE
	MOVE	P2,[POINT 8,T1,27]
	DPB	T2,P2		;PLACE HIGH BYTE
	AOS	P3		;BUMP COUNT OF ITEMS LISTED
	PUSHJ	P,.ODECW
	TYPEIT	<
	LINE DRIVER STATUS AT LAST ERROR INTERRUPT
	 REC. STATUS REGISTER: >
	ILDB	T1,P4		;GET NEXT BYTE
	ILDB	T2,P4		;GET HI BYTE
	DPB	T2,P2		;PLACE HIGH BYTE
	PUSHJ	P,.TOCTW
	AOS	P3		;BUMP COUNT
	TYPEIT	<
	 XMIT STATUS REGISTER:	>
	ILDB	T1,P4		;AGAIN,NEXT BYTE
	ILDB	T2,P4		;GET HI BYTE
	DPB	T2,P2		;PLACE HIGH BYTE
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	AOS 	P3
	;NOW USE ITEM DESCRIPTION TABLES AND A LOOP.
S6%LS0: ;CHANGED WITH EDIT 546
	MOVE T1,S6%NAM(P3)	;GET ADDRESS OF ITEM NAME
	PUSHJ	P,.TSTRG
	PUSHJ	P,.TTABC
	ILDB	T1,P4		;GET THE COUNTER VALUE
	ILDB	T2,P4		;GET HI BYTE
	DPB	T2,P2		;PLACE HIGH BYTE
	PUSHJ	P,.ODECW	;PRINT DEC.VALUE WITH PERIOD
	AOS	P3		;BUMP COUNT
	CAIN	P3,32		;DONE ALL 32 ITEMS?
	 JRST ABORT		;YES-DONE WITH ENTRY
	PUSHJ	P,.TTABC	;SPACE OVER
	MOVE T1,S6%NAM(P3)	;GET ADDRESS OF ITEM NAME
	PUSHJ	P,.TSTRG
	PUSHJ	P,.TTABC
	ILDB	T1,P4		;GET THE COUNTER VALUE
	ILDB	T2,P4		;GET HI BYTE
	DPB	T2,P2		;PLACE HIGH BYTE
	PUSHJ	P,.ODECW	;PRINT DEC.VALUE WITH PERIOD
	AOS	P3		;BUMP COUNT
	PUSHJ	P,.TCRLF	;NEXT LINE
	CAIE	P3,32		;ALL DONE?
	 JRST	S6%LS0		;NO, GET NEXT
	JRST	ABORT		;END OF ENTRY
S6%LSA:	 TYPEIT (D60SPL SIGNED ON)
		    POPJ	P,0
S6%LSB:	 TYPEIT ( ENTRY RECORDED ON THE HOUR)
		    POPJ	P,0
S6%LSC:	 TYPEIT (D60SPL SIGNED OFF)
		    POPJ	P,0
S6%LSD:	 TYPEIT (UNKNOWN)
		    POPJ	P,0

;HERE TO TYPE OUT PORT,LINE AND DEVICE NUMBERS FOR DN64
;INSERTED BY EDIT [723] TJW


S6%LNT:	TYPEIT	<
	PORT #: >
	LDB	T1,[POINT 8,P2,7]
	PUSHJ	P,.TOCTW		;
	TYPEIT	<	LINE #: >
	LDB	T1,[POINT 8,P2,15]
	PUSHJ	P,.ODECW
	TYPEIT 	<	DEVICE #: >
	LDB	T1,[POINT 8,P2,23]
	PUSHJ	P,.ODECW
	TYPEIT	<
	LINE DRIVER TYPE: >
	LDB 	T2,[POINT 8,P2,31]
	MOVE	T1,[SIXBIT/DQ11/]	;ASSUME SOMETHING
	CAIN	T2,2			;BUT CHECK
	 MOVE 	T1,[SIXBIT/DUP11/]
	PJRST	.TSIXN		;SAY IT IN SIXBIT
;HERE ARE NAMES OF ITEM COUNTERS
S6%NAM:	0
	0	;FIRST 3 ALREADY LISTED VIA "TYPEIT" AND COUNTER IS BUMPED
	0	;AFTER LISTING SO 2 BLANKS ARE NEEDED
	[ASCIZ/RECEIVER OVERRUN/]
	[ASCIZ/TRANSMITTER OVERRUN/]
	[ASCIZ/CLEAR-TO-SEND FAILS/]
	[ASCIZ/MSG'S SENT & ACK'D/]
	[ASCIZ/MSG'S SENT & NAK'D/]
	[ASCIZ/INVALID RESP. TO TTD/]
	[ASCIZ/INVALID RESP. TO MSG'S/]
	[ASCIZ/TTD'S SENT/]
	[ASCIZ/WACKS'S REC'D/]
	[ASCIZ/	EOT'S IN RESP. TO MSG'S/]
	[ASCIZ/INVALID BIDS OR RESP.TO BIDS/]
	[ASCIZ/RVI'S REC'D WHILE X-MIT/]
	[ASCIZ/MSG'S REC'D & ACK'D/]
	[ASCIZ/BAD BCC'S/]
	[ASCIZ/NAK'S SENT FOR DATA MSG'S/]
	[ASCIZ/WACK'S SENT/]
	[ASCIZ/TTD'S REC'D/]
	[ASCIZ/	EOT'S SENT OR REC'D/]
	[ASCIZ/MSG'S IGNORED/]
	[ASCIZ/	TRANSPARENT MSG'S W. INVALID CHAR. AFTER DLE/]
	[ASCIZ/ATTEMPTS TO CHANGE MODE IN BLOCKED MSG/]
	[ASCIZ/TRANSMITTER TIMEOUTS/]
	[ASCIZ/CTS DELAY IN JIFFIES/]

	;HERE STARTS THE CODE FOR THE DN6x ENTRIES CREATED WITH TOPS-20 RELEASE 4 AND
	;LATER.  FIRST IS FOR THE LINE STATISTICS, SECOND IS THE
	;ENABLE DISABLE REPORT.

	;HERE STARTS THE CODE FOR 233 ENTRIES, P2 HAS DN6COD

D6%LST:	;START EDIT [1267]
	TYPEIT	<
	PORT NUMBER:	>
	LDB	T1,[POINT 18,P2,17]
	PUSHJ	P,.TOCTW
	TYPEIT	<
	LINE NUMBER:	>
	LDB	T1,[POINT 18,P2,35]
	PUSHJ	P,.TOCTW
	MOVE	P2,WKBUFF+DN6COD
; END EDIT [1267]
	TYPEIT	<
	TERMINAL TYPE:	>
	LDB	T2,[POINT 8,P2,7]
	MOVEI	T1,[ASCIZ/Unkn/]
	CAIN	T2,1
	 MOVEI	T1,[ASCIZ/3780/]
	CAIN	T2,2
	 MOVEI	T1,[ASCIZ/2780/]
	CAIN	T2,3
	 MOVEI	T1,[ASCIZ/HASP/]
	PUSHJ	P,.TSTRG
	TYPEIT	<
	STATUS FLAGS:	>
	LDB	P1,[POINT 8,P2,15]
	MOVEI	T1,[ASCIZ/Simulate,/]
	TRNN	P1,1B35
	 MOVEI	T1,[ASCIZ/Support,/]
	PUSHJ	P,.TSTRG
	MOVEI	T1,[ASCIZ/Primary BSC Protocol,/]
	TRNN	P1,1B34
	 MOVEI	T1,[ASCIZ/Secondary BSC Protocol,/]
	PUSHJ	P,.TSTRG
	TRNE	P1,1B33
	 PUSHJ	P,[TYPEIT  <Signed on,>
		popj	p,0]
	TRNE	P1,1B32
	 PUSHJ	P,[TYPEIT  <Transparent,>
		popJ	P,0]
	TRNE	P1,1B31
	 PUSHJ	P,[TYPEIT  <Disable in progress,>
		popj	P,0]
	TRNE	P1,1B30
	 PUSHJ	P,[TYPEIT  <Line Enable complete,>
		poPJ	P,0]
	TRNE	P1,1B29
	 PUSHJ	P,[TYPEIT  <Line Abort Complete,>
		POPJ	p,0]
	trnE	P1,1B28
	 PUSHJ	P,[TYPEIT  <Off Line,>
		POPJ	P,0]
	LDB	P1,[POINT 8,P2,23]
	TRNE	P1,1B35
	 PUSHJ	P,[TYPEIT   <Line Disable Complete>
		POPJ P,0]
	TRNE	P1,1B34
	 PUSHJ	P,[TYPEIT  <Disable done by DTE failure,>
		POPJ	P,0]
	TRNE	P1,1B33
	 PUSHJ	P,[TYPEIT  <Line aborted by HDWR failure,>
		POPJ	P,0]
	TRNE	P1,1B32
	 PUSHJ	P,[TYPEIT  <Communications Established>	
		POPJ	P,0]
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	LDB	P1,[POINT 8,P2,31]
	TRNE	P1,1B35
	 PUSHJ	P,[TYPEIT  <Line Enabled,>
		POPJ	P,0]
	TRNE	P1,1B34
	 PUSHJ	P,[TYPEIT  <DTR,>
		POPJ	P,0]
	TRNE	P1,1B33
	 PUSHJ	P,[TYPEIT  <DSR>
		POPJ	P,0]
	PUSHJ	P,.TCRLF

; NOW SWAP THE BYTES AND USE THE TABLE APPROACH

	MOVE	P1,[-^D17,,DN6DAT]	;SETUP
	PUSHJ	P,SWPBYT	;SWAP THE BYTES AROUND
	TYPEIT	<Count of DQ11-DUP11 Error Interrupts>
	PUSHJ	P,.TTABC
	ldb	T1,[POINT 16,WKBUFF+DN6DAT,15]
	PUSHJ	P,.ODECW
	PUSHJ	P,.TCRLF
	TYPEIT 	<DQ11-DUP11 STATUS REGISTER 1 AT LAST ERROR  >
	LDB	T1,[POINT 16,WKBUFF+DN6DAT,31]
	PUSHJ	P,.TOCTW
	TYPEIT	<
DQ11-DUP11 STATUS REGISTER 2 AT LAST ERROR  >
	LDB	T1,[POINT 16,WKBUFF+DN6DAT+1,15]
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCRLF
	;
	;NOW USE THE TABLE APPROACH
	;

	MOVE	P4,[POINT 16,WKBUFF+DN6DAT+1,15]	;INITIAL BYTE POINTER
	SETZM	P3
D6%LS1: MOVE	T1,DN6TXT(P3)		;ADDRESS OF TEXT
	PUSHJ	P,.TSTRG
	PUSHJ	P,.TTABC		;ADD SOME SPACE
	ILDB	T1,P4			;GET THE VALUE
	PUSHJ	P,.ODECW		;IN DECIMAL WITH A '.'
	PUSHJ	P,.TTABC		;ADD SOME SPACE
	AOS	P3
	CAIN	P3,^D30		;ALL DONE?
	 JRST	ABORT		;YES
	PUSHJ	P,.TCRLF
	JRST	D6%LS1
	;HERE ARE THE ASCIZ MESSAGES
DN6TXT:[ASCIZ/Count of time receiver wasn't fast enough/]
	[ASCIZ/Count of times transmitter wasn't fast enough/]
	[ASCIZ/Count of CTS (Clear To Send) failures/]
	[ASCIZ/Count of msgs sent and ACKed/]
	[ASCIZ/Count of NAK's received(+wrong ack after timeout)/]
	[ASCIZ/Count of invalid responses to TTD/]
	[ASCIZ/Count of invalid responses to messages/]
	[ASCIZ/Count of TTD's sent/]
	[ASCIZ/Count of WACK's Rec'd/]
	[ASCIZ/Count of EOT's (Aborts) in response to messages/]
	[ASCIZ/Count of invalid bids of responses to bids/]
	[ASCIZ/Count of RVI's received while transmitting/]
	[ASCIZ/Count of messages received OK/]
	[ASCIZ/Count of bad BCC's/]
	[ASCIZ/Count of NAK's sent/]
	[ASCIZ/Count of WACK's sent/]
	[ASCIZ/Count of TTD's received/]
	[ASCIZ/Count of EOT's sent or rec'd which abort the stream/]
	[ASCIZ/Count of msg's ignored/]
	[ASCIZ/Count of transparent msg with invalid char after DLE/]
	[ASCIZ/Count of attempts to change between transparent and normal mode in a blocked msg/]
	[ASCIZ/Count of transmitter timeouts/]
	[ASCIZ/Clear to send delay in JIFFIES/]
	[ASCIZ/Count of silo overflows/]
	[ASCIZ/Number of bytes in silo warning area/]
	[ASCIZ/Max number of bytes used in silo warning area since last set/]
	[ASCIZ/Max bytes per message/]
	[ASCIZ/Number of records per message/]
	[ASCIZ/Line signature/]
	[ASCIZ/Line Driver Type/]

DS%LST:	MOVE	P1,[-^D17,,DN6DAT]	;SETUP
	PUSHJ	P,SWPBYT	;SWAP THE BYTES AROUND
	POPJ	P,0		;ALL DONE

	;HERE IS THE CODE FOR 234 ENTRIES, NODE NAME HAS ALREADY BEEN LISTED
	;P2 HAS DNECOD

DE%LST:	TYPEIT	<
	NODE WAS >
	MOVEI	T1,[ASCIZ/ENABLED/]
	CAIN	P2,2		;WAS LINE DISABLED?
	 MOVEI	T1,[ASCIZ/DISABLED/]
	PUSHJ	P,.TSTRG	;SAY EITHER
	SKIPN	P2,WKBUFF+DNEPRT	;GET PORT,,LINE IF THERE
	 POPJ	P,0		;ALL DONE
	TYPEIT	<
	PORT #:	>
	HLRZ	T1,P2
	PUSHJ	P,.TOCTW
	TYPEIT	<
	LINE #:	>
	HRRZ	T1,P2
	PUSHJ	P,.TOCTW
	SKIPN	P2,WKBUFF+DNEFLG	;GET FLAGS & STATION TYPE
	 POPJ	P,0		;ALL DONE
	TYPEIT	<
	STATION TYPE: 	>
	HRRZ	T2,P2
	CAIN	T2,1		;3780?
	 MOVEI	T1,[ASCIZ/3780/]
	CAIN	T2,2		;2780?
	 MOVEI	T1,[ASCIZ/2780/]
	CAIN	T2,3		;HASP?
	 MOVEI	T1,[ASCIZ/HASP/]
	PUSHJ	P,.TSTRG	;SAY WHAT'S IN T1
	PUSHJ	P,.TCRLF
	PUSHJ	P,.TTABC
	HLRZ	P2,P2
	TRNE	P2,1B33		
	 PUSHJ	P,[TYPEIT  <Transparency Enabled,>
		   POPJ	P,0]
	MOVEI	T1,[ASCIZ/ Primary Protocol,/]
	TRNN	P2,1B34		;WHICH ONE?
	 MOVEI	T1,[ASCIZ/ Secondary Protocol, /]
	PUSHJ	P,.TSTRG
	MOVEI	T1,[ASCIZ/ Emulation Mode/]
	TRNN	P2,1B35
	 MOVEI	T1,[ASCIZ/ Termination Mode/]
	PUSHJ	P,.TSTRG
	SKIPN	P2,WKBUFF+DNECTS
	 POPJ	P,0
	TYPEIT	<
	CLEAR TO SEND DELAY IN JIFFIES:	>
	MOVE	T1,P2
	PUSHJ	P,.TOCTW
	SKIPN	P2,WKBUFF+DNESWL
	 POPJ	P,0
	TYPEIT	<
	SILO WARNING LEVEL IN BYTES:	>
	MOVE	T1,P2
	PUSHJ	P,.TOCTW
	SKIPN	P2,WKBUFF+DNEBPM
	 POPJ	P,0
	TYPEIT	<
	BYTES PER MESSAGE:		>
	MOVE	T1,P2
	PUSHJ	P,.TOCTW
	SKIPN	P2,WKBUFF+DNERPM
	 POPJ	P,0
	TYPEIT	<
	RECORDS PER MESSAGE:		>
	MOVE	T1,P2
	PUSHJ	P,.TOCTW
	SKIPN	P2,WKBUFF+DNESIG
	 POPJ	P,0
	TYPEIT	<
	LINE SIGNATURE:			>
	MOVE	T1,P2
	PUSHJ	P,.TOCTW
	POPJ	P,0
	;START EDIT [522]

	;ROUTINE FOR LISTING NETWORK LINE COUNTERS
	;CALLED WITH LC%RSM IN P2

LC$CNT:	TYPEIT	<
	REASON FOR ENTRY:  >
	MOVEI	T1,[ASCIZ/NOT SUPPLIED/]	;START WITH WORST
	CAIN	P2,1
	 MOVEI	T1,[ASCIZ/SIGN ON/]
	CAIN	P2,2
	 MOVEI	T1,[ASCIZ/PERIODIC ENTRY/]
	CAIN	P2,3
	 MOVEI	T1,[ASCIZ/SIGN OFF/]
	CAIN	P2,4
	 MOVEI	T1,[ASCIZ/VALUES NOT OBTAINED/]
	PUSHJ	P,.TSTRG		;LIST WHAT WE BUILT
	MOVE	P2,WKBUFF+NH%PTR	;GET POINTER TO DATA [1244]
	TLNN	P2,-1			;TEST FOR MISSING COUNTERS [1244]
	JRST	LC.NCN			;PRINT MISSING COUNTERS MESSAGE [1244]
LC.CNT:	PUSHJ	P,.TCRLF
	SKIPN	T1,WKBUFF(P2)		;GET A VALUE IF PRESENT
	 POPJ	P,0			;=0,GO BACK
	HRRZ	T1,WKBUFF(P2)		;GET COUNT
	TRNE	T1,1B20			;OVERFLOW?
	 PUSHJ	P,LC.OVF		;YES!
	PUSHJ	P,.ODECW		;NO! - OUTPUT VALUE IN DECIMAL
	PUSHJ	P,.TTABC		;TAB
	HLRZ	T1,WKBUFF(P2)		;GET TYPE
	MOVE	T1,LC$TYP(T1)		;GET STRING POINTER
	PUSHJ	P,.TSTRG		;OUTPUT IT
	AOBJN	P2,LC.CNT		;DONE?
	 POPJ	P,0			;YES! - EXIT

LC.NCN:	TYPEIT	<  COUNTERS NOT SUPPLIED 
>					;[1244]
	POPJ	P,			;RETURN [1244]

LC.OVF:	MOVEI	T1,">"			;OUTPUT
	PUSHJ	P,.TCHAR		; 'GREATER THAN'
	MOVEI	T1,400000		; '131072.'
	POPJ	P,0			;CONTINUE

	;NAMES OF LINE COUNTERS

LC$TYP:	[ASCIZ/SECONDS SINCE LAST ZEROED/]
	[ASCIZ/BLOCKS RECEIVED/]
	[ASCIZ/BLOCKS SENT/]
	[ASCIZ/LINE ERROR RETRANSMISSIONS/]
	[ASCIZ/RECEIVED LINE ERRORS/]
	[ASCIZ/NON - LINE ERROR RETRANSMISSIONS/]
	[ASCIZ/RECEIVE TIMEOUTS/]
	[ASCIZ/RECEIVE SELECTION ERRORS/]
	[ASCIZ/RESOURCE ERRORS/]
	[ASCIZ/NACKS SENT(DDCMP)/]
	[ASCIZ/NACKS REC'D(DDCMP)/]

	;END EDIT [522]
	;LC$3ER-LC$4ER LISTS CONTENTS OF TYPE 3 & 4 ERROR COUNTERS FOR
	;BRIEF SUPPORT  CALLED PUSHJ WITH P2/NH%PTR

LC$3ER:	HLRZ	T1,WKBUFF(P2)	;GET A COUNTER VALUE
	CAIN	T1,3
	 JRST	LC$3E1		;GOT IT
	AOBJN	P2,LC$3ER	;TRY NEXT
	POPJ	P,0
LC$3E1:	HRRZ	T1,WKBUFF(P2)	;GET VALUE
	CAIN	T1,1B20		;OVERFLOW
	 PUSHJ	P,LC.OVF	;HANDLE IT
	PUSHJ	P,.ODECW
	POPJ	P,0

LC$4ER:	HLRZ	T1,WKBUFF(P2)	;GET A COUNTER VALUE
	CAIN	T1,4
	 JRST	LC$4E1		;GOT IT
	AOBJN	P2,LC$4ER	;TRY NEXT
	POPJ	P,0
LC$4E1:	HRRZ	T1,WKBUFF(P2)	;GET VALUE
	CAIN	T1,1B20		;OVERFLOW
	 PUSHJ	P,LC.OVF	;HANDLE IT
	PUSHJ	P,.ODECW
	POPJ	P,0
	;ROUTINE FOR LISTING NETWORK NODE COUNTERS
	;CALLED WITH NC%RSM IN P2

NC$CNT:	TYPEIT	<
	REASON FOR ENTRY:  >
	MOVEI	T1,[ASCIZ/NOT SUPPLIED/]	;START WITH WORST
	CAIN	P2,1
	 MOVEI	T1,[ASCIZ/SIGN ON/]
	CAIN	P2,2
	 MOVEI	T1,[ASCIZ/PERIODIC ENTRY/]
	CAIN	P2,3
	 MOVEI	T1,[ASCIZ/SIGN OFF/]
	CAIN	P2,4
	 MOVEI	T1,[ASCIZ/VALUES NOT OBTAINED/]
	PUSHJ	P,.TSTRG		;LIST WHAT WE BUILT
	SKIPN	P2,WKBUFF+NC%PTR	;POINTER TO THE DATA
	 POPJ	P,0			;NOT THERE?
	TYPEIT	<
VALUES FOR THIS NODE:	>
NC.CNT:	PUSHJ	P,.TCRLF
	SKIPN	T1,WKBUFF(P2)		;GET A VALUE IF PRESENT
	 JRST	NCDCNT			;=0,GO BACK
	HRRZ	T1,WKBUFF(P2)		;GET COUNT
	TRNE	T1,1B20			;OVERFLOW?
	 PUSHJ	P,LC.OVF		;YES!
	PUSHJ	P,.ODECW		;NO! - OUTPUT VALUE IN DECIMAL
	PUSHJ	P,.TTABC		;TAB
	HLRZ	T1,WKBUFF(P2)		;GET TYPE
	MOVE	T1,NC$TYP(T1)		;GET STRING POINTER
	PUSHJ	P,.TSTRG		;OUTPUT IT
	AOBJN	P2,NC.CNT		;DONE?
NCDCNT:	;NOW DO COUNTERS FOR EACH DESTINATION NODE
	TYPEIT	<
VALUES FOR EACH DESTINATION NODE FROM THIS NODE:	>
	SKIPN	P1,WKBUFF+NC%NDP	;POINTER TO TABLE OF POINTERS
	 POPJ	P,0			;THERE ARE NONE?
NCDCN1:	SKIPN	P2,WKBUFF(P1)		;GET A POINTER TO A SUB-BLOCK
	 POPJ	P,0
NCDCN2:	PUSHJ	P,.TCRLF
	HRRZ	T1,WKBUFF(P2)		;GET COUNT
	TRNE	T1,1B20			;OVERFLOW?
	 PUSHJ	P,LC.OVF		;YES!
	PUSHJ	P,.ODECW		;NO! - OUTPUT VALUE IN DECIMAL
	PUSHJ	P,.TTABC		;TAB
	HLRZ	T1,WKBUFF(P2)		;GET TYPE
	MOVE	T1,NC$TY1(T1)		;GET STRING POINTER
	PUSHJ	P,.TSTRG		;OUTPUT IT
	AOBJN	P2,NCDCN2		;DONE WITH THIS NODE?
	PUSHJ	P,.TCRLF		;EXTRA LINE FEED BETWEEN NODES.
	AOBJN	P1,NCDCN1		;YES,DONE ALL NODES ?
	 POPJ	P,0			;ALL DONE


	;NAMES OF NODE COUNTERS

NC$TYP:	[ASCIZ/ILLEGAL/]
	[ASCIZ/NACKS REC'D/]
	[ASCIZ/NACKS SENT/]
	[ASCIZ/EXTRANEOUS MSGS REC'D/]
	[ASCIZ/MSGS RETRANSMITTED/]
	[ASCIZ/MAX LOGICAL LINKS ACTIVE/]
	[ASCIZ/CURRENT LOGICAL LINKS ACTIVE/]
	[ASCIZ/RESOURCE ERRORS/]
	[ASCIZ/FORMAT ERRORS, ROUTING DATA/]
	[ASCIZ/FORMAT ERRORS, NON-ROUTING DATA/]
	[ASCIZ/UNKNOWN DESTINATION NODE/]
	[ASCIZ/MSGS ROUTED THROUGH/]
	[ASCIZ/MSGS TIMED OUT/]

NC$TY1:	[ASCIZ/DEST. NODE ID #/]
	[ASCIZ/USER MSGS SENT/]
	[ASCIZ/USER MSGS REC'D/]
	[ASCIZ/CONNECTS INITIATED/]
	[ASCIZ/CONNECTS ACCEPTED/]
	[ASCIZ/SINGLE MSGS SENT/]
	[ASCIZ/SINGLE MSGS REC'D/]



DEVTYP:0
	RLD1DV
	N001DV
	N002DV
	N003DV
	N004DV
	N005DV


	SUBTTL BIT CHECKING ROUTINES
	;BCKXXX -- SUBROUTINES TO DETERMINE LISTING AND SUMMATION
	;ELIGIBILITY BASED ON BITS IN THE ENTCHR TABLE.
	;CALL   PUSHJ P,BITCHK(ERROR CODE)
	;RTN    CALL + 1 TO LIST
	;	ABORT TO GET NEXT ENTRY


BCK201:
BCK202:

BCK203:

BCK210:
BCK211:

BCK220:
BCK221:
BCK222:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;GET CHARACTERISTICS
	TLNE	F,F.DEV	;[604]  TEST FOR DEVICE SWITCH
	JRST	ABORT
	TLNE	P2,E.LALL	;WANTS ALL?
	 POPJ	P,0		;YUP
	JRST	ABORT		;SORRY
	POPJ	P,0		;FOR NOW

BCK230:
BCK231:
BCK232:
BCK233:
BCK234:	MOVE	P1,ERTYPE
	MOVE	P2,ENTCHR(P1)	;GET CHARACTERISTICS
	TLNE	F,F.DEV	;[604]	TEST FOR DEVICE SWITCH AGAIN
	JRST	ABORT
	TLNE	P2,E.LALL	;WANTS ALL?
	 POPJ	P,0		;YUP
	TLNE	P2,E.LPER	;'/NETPER?
	 POPJ	P,0
	JRST	ABORT		;SORRY
	POPJ	P,0		;FOR NOW
	;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:	0 ;	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
;INPSPC:	EXP	13
;	SIXBIT/SYS/
;	XWD	0,IBUFF
;OUTSPC:	EXP	0
;	SIXBIT/DSK/
;	XWD	OBUFF,0
;ERRFIL:	XWD	0,35
;	Z
;	SIXBIT/ERROR/
;	SIXBIT/SYS/
;	BLOCK	32
;LSTFIL:	SIXBIT/ERROR/
;	SIXBIT/LST/
;	Z
;	Z
;	;HERE IS THE CODE WHICH WILL BE BUT INTO THE LOW SEG
;	;AND WILL BE CALLED TO OVERLAY HIGH SEGMENTS.
;	;EDIT #120
;
;
;	SETZM	.JBSYM		;TO ALLOW DDT TO WORK
;	SETZM	.JBUSY		;WHILE DEBUGGING VARIOUS HIGH
;				;SEGMENTS. PUT A BREAKPOINT
;				;AT ROUTINES WHICH CALL OVRLAY
;				;THEN SET BREAKPOINT AT THE
;				;RETURN FROM THE GETSEG AND OPEN
;				;THE NEW SYMBOL TABLE
;				;AND CONTINUE DEBUGGING.
;	MOVEI	T1,OVRBLK	;SPEC BLOCK SETUP BY OUR CALLER
;	GETSEG	T1,
;	 HALT			;STD ERROR MESSAGES ARE OK
;	HRLZI	17,SAVEAC	;COPY BACK
;	BLT	17,17		;THE AC'S
;	HRRZ	15,400000	;THAT'S THE START OF THE NEW SEG
;	JRST	@15		;NOW GO THERE
;
;
;
;IARGST:	Z
;	Z
;	CHROUT		;LOCATION OF TYPEOUT ROUTINE IN SYSERR
;	Z
;	Z
;IAREND==.-1
;IARGLN==<IAREND-IARGST>+1	;LENGTH OF ARG BLOCK FOR .ISCAN
;

DUMDAY:	121165		;DUMMY NBS DAY FOR USE BY SCAN
KONMSK: 0
	RLD1SK
	N001SK
	N002SK
	N003SK
	N004SK
	N005SK



MINERB:  0
	MIRLD1
	MIN001
	MIN002
	MIN003
	MIN004
	MIN005

ERINDX:  0
	RLD1DX
	N001DX
	N002DX
	N003DX
	N004DX
	N005DX

;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

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

ERRTBL:	0		;FIRST FOUND MUST NOT BE 0
	DUMENT

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


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

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

>

.BR201:	BRF201
.CT201:	DUM201
	Z
.BR202:	BRF202
.CT202:	DUM202
	Z
.BR203:	BRF203
.CT203:	DUM203
	Z
.BR210:	BRF210
.CT210:	DUM210
	Z
.BR211:	BRF211
.CT211:	DUM211
	Z
.BR220:	BRF220
.CT220:	DUM220
	Z
.BR221:	BRF221
.CT221:	DUM221
	Z
.BR222:	BRF222
.CT222:	DUM222
	Z
.BR230:	BRF230
.CT230:	DUM230
	Z
.BR231:	BRF231
.CT231:	DUM231
	Z
.BR232:	BRF232
.CT232:	DUM232
	Z
.BR233:	BRF233
.CT233:	DUM233
	Z
.BR234:	BRF234
.CT234:	DUM234
	Z

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

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


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




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

	;TABLE FOR DISPATCH TO THE BYTE OPERANDS

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

	;MAKE DISPATCH TABLE

BYTDSP:;	DUMCH1
	;NOW THE BYTES THEMSELVES


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


;	DUMCH1
	;SWITCH MACRO EXPANSION NEXT


	;DEFINE THE SWITCHES WE RECOGNIZE

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

	;CALL MACRO TO DEFINE DEFAULTS

;	DEFVAL

	;NOW MAKE SWTCHS MACRO FOR USE WITH DOSCAN LATER
	SALL

	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',\]
	>

RLD1DV:	DURLD1
N001DV:	DUN001
N002DV:	DUN002
N003DV:	DUN003
N004DV:	DUN004
N005DV:	DUN005
	;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	RCINDX+A-MINRCB
;	ZZ
;	ZZ==ZZ+1
;	RELOC	ZZP
;>

;	XLIST
	LIST

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


	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	N001DX+A-MIN001
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
N001DX:	REPEAT	36-MIN001,<0>
	ZZ==0
	DUN001

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	N002DX+A-MIN002
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
N002DX:	REPEAT	36-MIN002,<0>
	ZZ==0
	DUN002

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	N003DX+A-MIN003
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
N003DX:	REPEAT	36-MIN003,<0>
	ZZ==0
	DUN003

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	N004DX+A-MIN004
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
N004DX:	REPEAT	36-MIN004,<0>
	ZZ==0
	DUN004

	DEFINE	TBLDEV(A,B)<
	ZZP==.
	RELOC	N005DX+A-MIN005
	ZZ
	ZZ==ZZ+1
	RELOC	ZZP
	>
N005DX:	REPEAT	36-MIN005,<0>
	ZZ==0
	DUN005
RADIX 8
;GENERATE SIXBIT TABLE OF DEVICE NAMES

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

MASNAM:	DUMFS
	DUMRP

	MASLTH=<.-1>-MASNAM+1	;LENGTH OF THIS TABLE
	;TABLES FOR TOPS20 DEVICES
	DEFINE DUMDV(A)<
	SIXBIT/A/
>
;MASNA2 TABLE REMOVED WITH EDIT  [1217]


	;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 REMOVED WITH EDIT  [1217]

DEVDSP:	DUMDVA



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

	END	STARTN