Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-12 - 43,50547/pltlib/cmisc1/illmem.mac
There is 1 other file named illmem.mac in the archive. Click here to see a list.
TITLE	ILLMEM - Routine to trap ILL MEM REFs
SUBTTL	Joe Smith, CSM, 28-Jun-83

	T1=1
	T2=2
	T3=3
	T4=4
	L=16
	P=17

	SEARCH	MACTEN,JOBDAT,UUOSYM
	SALL

; CALL ILLMEM(1)		!To enable trapping
; CALL ILLMEM(0)		!To disable it

	ENTRY	ILLMEM
	SIXBIT	/ILLMEM/
ILLMEM:	SKIPE	T1,@0(L)	;Turn on trapping?
	 MOVEI	T1,INTBLK	;Yes, get addr of interrupt block
	MOVEM	T1,.JBINT	;Store
	SETZM	OLDPC		;Clear possible garbage
	POPJ	P,

INTBLK:	XWD	4,NEWPC		;4 words long, new PC after interrupt
	EXP	ER.EIJ		;Catch error in job (Ill Mem Ref)
OLDPC:	0			;PC at time of error
	0			;Code for actual error

NEWPC:	OUTSTR	[ASCIZ /   [ILLMEM - Starting trace]/]
	PUSH	P,OLDPC		;Put address of error on stack
	PUSHJ	P,TRACE.##	;Ask FOROTS to trace subroutine calls
	POP	P,.JBOPC	;Store error PC
	OUTSTR	[ASCIZ /?ILLMEM - Aborting due to Ill Mem Ref/]
	MONRT.			;Quiet exit
	HALT	@.JBOPC		;Cannot CONTinue

	END