Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/debugging-tools/kdpsts.mac
There are no other files named kdpsts.mac in the archive.
	TITLE	KDPSTS

	SEARCH	MONSYM,MACSYM
	SALL

;AC DEFINITIONS
	F=0
	AC1=1
	AC2=2
	AC3=3
	AC4=4
	P1=6
	P2=7
	P3=10
	P4=11
	P=17

	OPDEF RDIO [712000,,000]
KMCPAG:	BLOCK 1000
PDLEN=100
PDL:	BLOCK 100
PGDSTS==2
PGLSTS==5
	DP%DSR==1B13
DDSTA:	POINT 3,PGDSTS(P1),35	;POINTER TO LINE STATE
	STASTR==2
	STASTK==3
	STARUN==4
PGDMNM==7	;DDCMP MESSAGE NUMBERS
DDREPC:	POINT 12,PGDMNM(P1),35	;REP COUNTER
;DUP11 HARDWARE BITS

DUPDTR==000002
DUPRTS==000004
DUPDSR==001000
DUPCAR==010000
DUPCTS==020000
DUPRNG==040000
RESTRT:	RESET
	SETZ 0,			;ZERO THE AC'S
	MOVEI 17,1		;
	BLT 17,17		;
	MOVE P,[-PDLEN,,PDL]	;SET UP THE STACK
	SETZM SYMFLG		;ASSUME NO SYMBOL ADDRESSES YET
	HRROI AC1,[ASCIZ \
	KDPSTS on \]
	PSOUT			;BEGGINING OF BANNER
	MOVEI AC1,.NDGLN	;GET LOCAL NODE NAME
	MOVE AC2,[POINT 7,ARGBLK+.NDNOD+1]
	MOVEM AC2,ARGBLK+.NDNOD
	MOVEI AC2,ARGBLK	;POINT TO BLOCK
	NODE			;GET THE NODE NAME
	ERCAL TRBL
	HRROI AC1,ARGBLK+.NDNOD+1
	PSOUT			;TYPE IT OUT
	MOVEI AC1,"("
	PBOUT
	MOVEI AC1,.NDGNM	;GET LOCAL NODE NUMBER
	MOVEI AC2,ARGBLK	;POINT TO BLOCK
	NODE
	ERCAL TRBL
	MOVE AC2,ARGBLK+.NDNOD	;GET NODE NUMBER
	MOVEI AC1,.PRIOU	;TO THE TTY
	MOVEI AC3,^D10		;IN DECIMAL
	NOUT			;NODE NUMBER
	 ERCAL TRBL
	MOVEI AC1,[BYTE (7)")"," ",0]
	PSOUT
	MOVEI AC1,.PRIOU
	SETOM AC2
	SETZ AC3,
	ODTIM
	HRROI AC1,[BYTE (7)15,12,0]
	PSOUT
	MOVE AC1,[.FHSLF]
	RPCAP			;GET OUR CAPABILITIES
	DMOVEM AC2,OURCAP	;SAVE OUR CAPAGILITIES
	TDO AC3,AC2		;ENABLE ALL CAPABILITIES
	EPCAP			;GET EM
;NOW FIND VARIOUS MONITOR ADDRESSES
	SKIPE SYMFLG		;ARE SYMBOLS SETUP ?
	 JRST LOOPS5
	MOVEI P1,FIRSYM		;FIRST SYMBOL TO LOOKUP UP
LOOPS:	MOVEI AC1,.SNPSY	;OBTAIN ADR OF MONITOR SYMBOL
	DMOVE AC2,(P1)		;GET NAME OF SYMBOL AND ROUTINE
	SNOOP
	 ERCAL TRBL
	MOVEM AC2,2(P1)		;SAVE ADDRESS
	ADDI P1,3		;ON TO NEXT SYMBOL
	SKIPE (P1)		;IS THER ANOTHER ?
	JRST LOOPS		;YES SO GET IT
LOOPS5:	SETOM SYMFLG		;HAVE SETUP SYMBOLS
	MOVEI AC1,0		;FIRST PORT
LOOP2:	CALL SHOWLN		;DISPLAY STATE OF LINE
	 JRST [	MOVE AC1,[.FHSLF]
		DMOVE AC2,OURCAP ;ORIGINAL CAPABILITIES
		EPCAP		;RIGHT CAPABILITIES
		HALTF ]
	AOS AC1,ARGBLK+.BTPRT	;NEXT PORT
	JRST LOOP2
SHOWLN:	SETZM FIRZER
	MOVE AC2,[FIRZER,,FIRZER+1]
	BLT AC2,LSTZER
	MOVEM AC1,ARGBLK+.BTPRT	;SAVE LINE ARGUMENT IN BLOCK
	MOVEI AC1,.BTCPN	;CONVERT PORT NUMBER TO LINE ID
	MOVE AC2,[POINT 7,LID]
	MOVEM AC2,ARGBLK+.BTLID
	MOVEI AC2,ARGBLK
	BOOT
	ERJMP R
	MOVE AC1,ARGBLK+.BTPRT	;GET LINE NUMBER
	LSH AC1,^D9		;CONVERT TO PAGE NUMBER
	HRLI AC1,20		;GET 20 WORDS FROM LINES PAGE
	ADD AC1,KDP0PG
	MOVEI AC2,KMCPAG	;WHERE TO DUMP DATA
	PEEK
	ERJMP .+1
	MOVEI P1,KMCPAG		;POINT TO LINES PAGE
	HRROI AC1,[ASCIZ \
PORT \]
	PSOUT
	MOVE AC1,ARGBLK+.BTPRT
	MOVE AC2,AC1
	MOVEI AC1,.PRIOU
	MOVEI AC3,^D8
	NOUT
	 ERCAL TRBL
	HRROI AC1,[ASCIZ \ = \]
	PSOUT
	HRROI AC1,LID
	PSOUT
	MOVEI AC1,.BTSTS	;GET LINE PROTOCOL
	MOVEI AC2,ARGBLK
	BOOT
	ERJMP TRBL
	MOVE AC2,ARGBLK+.BTCOD	;GET POROTOCL STATUS FOR PORT
	HRROI AC1,[ASCIZ \ OFFLINE \]
	CAMN AC2,[EXP -1]
	 JRST SHOW4
	HRROI AC1,[ASCIZ \ DDCMP \]
	CAIN AC2,.VNDDC		;DDCMP ?
	 JRST SHOW2		;YES
	HRROI AC1,[ASCIZ \ MOP \]
	CAIN AC2,.VNMOP		;MAINTENANCE MODE ?
	 JRST SHOW4
	HRROI AC1,[ASCIZ \ Controller-loopback \]
	CAIN AC2,.VNCNL		;CONTROLLER LOOPBACK ?
	 JRST SHOW2		;YES
	HRROI AC1,[ASCIZ \ StRaNgE \]
	CAIE AC2,.VNCBL		;CABLE LOOPBACK ?
	 JRST SHOW4
	HRROI AC1,[ASCIZ \ Cable-loopback \]
SHOW2:	PSOUT
	LDB AC2,DDSTA		;GET LINE STATE
	HRROI AC1,[ASCIZ \(starting) \]
	CAIN AC2,STASTR		;STARTING ?
	 JRST SHOW4
	HRROI AC1,[ASCIZ \(stacking) \]
	CAIN AC2,STASTK		;SENDING STACK ?
	 JRST SHOW4
	MOVE AC1,ARGBLK+.BTPRT
	LSH AC1,1
	HRLI AC1,2		;WANT TWO WORDS
	ADD AC1,ITSNAM
	MOVEI AC2,AC3
	PEEK
	ERJMP .+1
	HRROI AC1,AC3
	PSOUT
	MOVEI AC1,"("
	PBOUT
	MOVE AC1,ARGBLK+.BTPRT	;GET LINE NUMBER AGAIN
	ADD AC1,ITSNUM		;ADR OF WORD WE WANT
	HRLI AC1,1		;WANT ONE WORD
	MOVEI AC2,AC1
	PEEK
	ERJMP .+1
	MOVE AC2,AC1
	MOVEI AC1,.PRIOU
	MOVEI AC3,^D10
	NOUT
	 ERCAL TRBL
	HRROI AC1,[ASCIZ \)\]
	CAIA
SHOW4:	SETZM PGDMNM(P1)	;CLEAR REP COUNTER
	PSOUT
	MOVEI AC1,.BTRLC	;CODE FOR GET LINE COUNTS
	MOVEI AC2,50
	MOVEM AC2,ARGBLK+.BTSCC	;NUMBER OF COUNTERS FOR STATUS
	MOVEM AC2,ARGBLK+.BTRCC ;NUMBER OF COUNTERS FOR RECEIVER
	MOVEM AC2,ARGBLK+.BTTCC ;NUMBER OF COUNTERS FOR TRANSMITER
	MOVE AC2,[POINT 36,STSCNT] ;POINTER TO STATUS COUNTERS
	MOVEM AC2,ARGBLK+.BTSCP
	MOVE AC2,[POINT 36,RCVCNT] ;POINTER TO RECEIVER COUNTERS
	MOVEM AC2,ARGBLK+.BTRCP
	MOVE AC2,[POINT 36,XMTCNT]
	MOVEM AC2,ARGBLK+.BTTCP
	MOVEI AC2,ARGBLK
	BOOT
	ERJMP TRBL
	HRROI AC1,[ASCIZ \	Seconds since zeroed \]
	PSOUT
	MOVE AC1,.BTZTM+ARGBLK
	CALL TYPDEC
	HRROI AC1,[BYTE (7)15,12,11,0]
	PSOUT
	LDB AC1,DDREPC		;GET REP COUNTER
	CAIG AC1,1		;IS THIS INTERESTING ?
	 JRST SHOW5		;NO
	HRROI AC1,[ASCIZ \REP counter = \]
	PSOUT
	LDB AC1,DDREPC		;GET REP COUNTER AGAIN
	CALL TYPDEC		;DISPLAY IT
	MOVEI AC1,11
	PBOUT
SHOW5:	USRIO
	ERJMP SHOW55
	MOVE AC1,ARGBLK+.BTDTE	;GET PORT NUMBER
	LSH AC1,3
	ADD AC1,DUPADR
	RDIO AC3,0(AC1)
	HRROI AC1,[ASCIZ \dtr \]
	TRNE AC3,DUPDTR
	 PSOUT
	HRROI AC1,[ASCIZ \dsr \]
	TRNE AC3,DUPDSR
	 PSOUT
	HRROI AC1,[ASCIZ \car \]
	TRNE AC3,DUPCAR
	 PSOUT
	HRROI AC1,[ASCIZ \rng \]
	TRNE AC3,DUPRNG
	 PSOUT
	HRROI AC1,[ASCIZ \rts \]
	TRNE AC3,DUPRTS
	 PSOUT
	HRROI AC1,[ASCIZ \cts \]
	TRNE AC3,DUPCTS
	 PSOUT
SHOW55:	HRROI AC1,[ASCIZ \(DSR not on) \]
	MOVX AC2,DP%DSR
	TDNN AC2,PGLSTS+KMCPAG
	 PSOUT
	MOVEI AC1,.NDFLP	;FIND LOOPBACK PORT
	MOVEI AC2,AC3		;POINT TO ARGUMENT BLOCK
	NODE			;FIND WHICH LINE WILL BE LOOPED
	ERJMP SHOW6
	JUMPE AC3,SHOW6		;IN CASE NO LOOPBACK LINES
	MOVE AC1,ARGBLK+.BTPRT	;GET PORT NUMBER FOR LINE
	CAIE AC1,(AC3)		;IS THIS THE ONE ?
	 JRST SHOW6		;NO
	HRROI AC1,[ASCIZ \
	Enabled for loopback\]
	TXNE AC3,ND%LPR		;IS LOOPBACK RUNNING ?
	 HRROI AC1,[ASCIZ \
	Running loopback\]
	PSOUT
SHOW6:	HRROI AC1,[ASCIZ \
HEADER	CRC	BNA	DSR	NXM	TURUN	RURUN	KILLC	OTHER
\]
	PSOUT
	MOVE P1,[POINT 36,STSCNT]
	MOVEI P2,50
	SUB P2,ARGBLK+.BTSCC
	CALL SHOW7
	HRROI AC1,[ASCIZ \
RCV	MISC	HDBCC	DBCC	REP	BTU	ROV	MTL	HFE
\]
	PSOUT
	MOVE P1,[POINT 36,RCVCNT]
	MOVEI P2,50
	SUB P2,ARGBLK+.BTRCC
	CALL SHOW7
	HRROI AC1,[ASCIZ \
XMT	MISC	HDBCC	DBCC	REP	BTU	ROV	MTL	HFE
\]
	PSOUT
	MOVE P1,[POINT 36,XMTCNT]
	MOVEI P2,50
	SUB P2,ARGBLK+.BTTCC
	CALL SHOW7
	HRROI AC1,[BYTE (7)15,12,0]
	PSOUT
RSKP:	AOS (P)
R:	RET

SHOW7:	ILDB AC1,P1
	CALL TYPDEC
	HRROI AC1,[BYTE (7)11,0]
	PSOUT
	SOJG P2,SHOW7
	RET

TYPDEC:	MOVE AC2,AC1
	MOVEI AC1,.PRIOU
	MOVEI AC3,^D10
	NOUT
	 ERCAL TRBL
	RET

TRBL:	TMSG <
?ERROR AT PC >
	MOVEI AC1,.PRIOU	;TO THE TTY
	HRRZ AC2,(P)		;CLOSE TO ERROR ADDRESS
	MOVEI AC2,-2(AC2)	;REAL ERROR ADDRESS
	MOVEI AC3,^D8		;IN OCTAL
	NOUT			;PRINT IT
	 ERCAL TRBL1		;DROP DEAD
	TMSG < ... >
	MOVEI AC1,.PRIOU	;TO THE TTY
	HRLOI AC2,.FHSLF	;FOR THIS PROCESS
	SETZ AC3,
	ERSTR			;THE ERROR STRING
	 ERCAL TRBL1
TRBL1:	HALTF			;STOP NOW
	HALTF

SYMFLG:	0		;SET NONZERO WHEN SYMBOLS SET UP
FIRSYM:	RADIX50 0,DUPADR
	0		;GLOBAL
DUPADR:	BLOCK 1
	RADIX50 0,ITSNAM
	0		;GLOBAL
ITSNAM:	BLOCK 1
	RADIX50 0,ITSNUM
	0		;GLOBAL
ITSNUM:	BLOCK 1
	RADIX50 0,KMCPAG
	0		;GLOBAL
KDP0PG:	BLOCK 1
LSTSYM:	0

OURCAP:	BLOCK 2		;OUR CAPABILITIES
FIRZER:
ARGBLK:	BLOCK 50
STSCNT:	BLOCK 50
RCVCNT:	BLOCK 50
XMTCNT:	BLOCK 50
LID:	BLOCK 2
LSTZER:	Z
	END RESTRT