Google
 

Trailing-Edge - PDP-10 Archives - tops10_tools_bb-fp64b-sb - 10,7/cshdpy/cshdmp.mac
There are 4 other files named cshdmp.mac in the archive. Click here to see a list.
	TITLE	CSHDMP - Dump out the cache

	SEARCH	MACTEN,UUOSYM
	.TEXT	|,REL:MAP,REL:SCAN/SEARCH/INCLUDE:.TOUTS|

	TWOSEG
	RELOC	400K

	T4=<1+<T3=1+<T2=1+<T1=1>>>>
	P4=<1+<P3=1+<P2=1+<P1=5>>>>
	U=12
	P=17

	ND	LN$PDL,50

	ND	CODRIB,777777
	ND	RIBCOD,176
	ND	UDBNAM,0
	ND	UNILOG,13
	ND	JACCT,1

	ND	MX$BLK,^D300
	PHASE	0

.CBNHB:! BLOCK	1			;NEXT HASH BLOCK
.CBPHB:! BLOCK	1			;PREVIOUS HASH BLOCK
.CBNAB:! BLOCK	1			;NEXT ACCESSED BLOCK
.CBPAB:! BLOCK	1			;PREVIOUS ACCESS BLOCK
.CBUDB:! BLOCK	1			;UDB OF UNIT
.CBBLK:! BLOCK	1			;THE BLOCK NUMBER
.CBDAT:! BLOCK	1			;ADDRESS OF BLOCK IN CORE
.CBHIT:! BLOCK	1			;HITS THIS BLOCK

.CBLEN:!				;LENGTH

	DEPHASE
CSHDMP:	JFCL
	RESET
	MOVE	P,[IOWD LN$PDL,PDL]
	MOVEI	T1,.TOCHR##
	PUSHJ	P,.TOINI##
	MOVE	T1,[MP.SPY##]
	MOVEM	T1,MAPARG
	MOVEI	T1,MAPARG
	PUSHJ	P,.MAPI##
	 JRST	MAPERR

	PUSHJ	P,CCSET
	PUSHJ	P,SETPRV
	MOVEI	P3,1
	MOVX	T1,%LDCHD
	PUSHJ	P,.MAPG##
	 JRST	MAPERR
	MOVE	P2,T1
	MOVEI	T1,.CBNAB(T1)
	PUSHJ	P,.MAPE##
	 JRST	MAPERR
	MOVE	P1,T1
	MOVEI	T1,TTL
	PUSHJ	P,.TSTRG##

LOOP:	CAMN	P2,P1
	 JRST	LOOPE
	PUSHJ	P,DMPBLK
	MOVEI	T1,.CBNAB(P1)
	PUSHJ	P,.MAPE##
	 JRST	MAPERR
	MOVE	P1,T1
	AOJA	P3,LOOP

LOOPE:	EXIT

TTL:	ASCIZ	/
       Unit   Block#   Hits   Typ          File
      ------  ------  ------  ---  --------------------
/
MAPERR:	OUTSTR	[ASCIZ/
?Unhandled MAP error: /]
	OUTSTR	MAPDAT##+.MPMET##
	OUTSTR	[BYTE(7) .CHCRT, .CHLFD]
	OUTSTR	MAPDAT##+.MPXET##
	EXIT

	SUBTTL	CCSET - Setup for ^C trapping

CCSET:	MOVE	T1,[4,,CCTRAP]		;NEW PC
	MOVEM	T1,CCBLK+.ERNPC		;SAVE
	MOVX	T1,ER.ICC		;^C TYPE
	MOVEM	T1,CCBLK+.ERCLS		;SAVE
	SETZM	CCBLK+.EROPC		;CLEAR OLD PC
	MOVEI	T1,CCBLK		;GET TRAP BLOCK ADDRESS
	MOVEM	T1,.JBINT		;ENABLE ^C TRAPS
	POPJ	P,			;AND RETURN

CCTRAP:	PUSH	P,CCBLK+.EROPC		;SAVE OLD PC
	SETZM	CCBLK+.EROPC		;RE-ENABLE
	EXIT	1,			;EXIT QUICKLY
	POPJ	P,			;RETURN IF CONTINUE
	SUBTTL	SETPRV - Set JACCT so we can SUSET.

SETPRV:	MOVX	T1,%LDFFA		;GET GOD
	GETTAB	T1,			;..
	 MOVE	T1,[1,,2]		;DEFAULT
	GETPPN	T2,			;OUR PPN
	 JFCL
	CAMN	T1,T2			;MATCH?
	 POPJ	P,			;YES--ALL SET
	MOVE	T1,[.GTSTS,,.GTSLF]	;GETTAB STATUS WORD TABLE
	GETTAB	T1,			;..
	 POPJ	P,			;CANT
	ANDI	T1,-1			;KEEP JUST ADDRESS
	PJOB	T2,			;GET CURRENT JOB
	ADDI	T1,(T2)			;INDEXED BY MY JOB
	HRROI	T2,.GTSTS		;GET MY STATUS WORD
	GETTAB	T2,			;..
	 POPJ	P,			;CANT
	MOVE	T3,T2			;COPY
	T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