	.TITLE *** TASK TERMINATION NOTICE PROCESSOR
/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/
/ EDIT #5	22 NOV 71	H. KREJCI
/				C. PROTEAU
/
/ COPYRIGHT 1971, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/ TASK, NAMED "TNTERM", WHICH NORMALLY RESIDES IN THE MCR PARTITION,
/ AND WHICH IS CALLED TO DE-QUEUE NODES FROM THE TASK TERMINATION
/ NOTICE LIST ("TNRL") AND TO PRINT A MESSAGE INDICATING THE REASON A
/ TASK WAS TERMINATED.
/
/ NODE FORMAT:
/	FORWARD LINKAGE
/	BACKWARD LINKAGE
/	TASK NAME (FIRST HALF)
/	TASK NAME (SECOND HALF)
/	TERMINATION INDICATOR
/	PC OR COUNT
/	AC
/	XR
/
R1=101			/GENERAL REGISTER #1.
R2=102			/GENERAL REGISTER #2.
X10=10			/AUTOINCREMENT REGISTER 10.
X12=12			/AUTOINCREMENT REGISTER 12.
X13=13			/AUTOINCREMENT REGISTER 13.
NADD=107		/ENTRY POINT TO REENTRANT "ADD NODE TO DEQUE" SUBR.
PICK=120		/ENTRY POINT TO REENTRANT "PICK NODE FROM DEQUE" SUBR.
POOL=240		/LISTHEAD OF THE EMPTY NODES DEQUE.
TNRL=256		/LISTHEAD OF THE TASK TERMINATION NOTICE DEQUE.
LUN=3			/LUN VIA WHICH THE MESSAGE IS PRINTED.
/
PTN	LAC	(TNRL)	/PICK NODE FROM TERMINATION NOTICE REQUEST LIST
	DAC*	(R1)
	JMS*	(PICK)	/LIST EMPTY?
	CAL	(10)	/YES -- EXIT
	DAC	NADR	/NO -- SAVE NODE ADDRESS & OUTPUT NOTICE
	IAC
	DAC*	(X10)
/
	DZM	CHCT	/CLEAR CHARACTER COUNT
	LAC	(LINE+1)	/SETUP X13 TO FILL LINE
	DAC*	(X13)
/
	LAC*	X10	/PACK "*** TSKNAM, "
	DAC	MES1+2
	LAC*	X10
	DAC	MES1+3
	LAC	(MES1)
	JMS	PSM
/
	LAC*	X10	/FETCH TERMINATION INDICATOR
	SAD	(1)	/IF 1, MEMORY PROTECT VIOLATION
	JMP	TT1
	SAD	(2)	/IF 2, NONEXISTENT MEMORY REFERENCE
	JMP	TT2
	SAD	(3)	/IF 3, BAD CAL ADDRESS
	JMP	TT3
	SAD	(4)	/IF 4, NON-0 TRANSFERS PENDING COUNT.
	JMP	TT4
	JMP	RETURN	/UNDEFINED INDICATOR. IGNORE REQUEST.
/
TT1	LAC	(MES2)	/PACK "MEM PROTECT ERR, PC = X XXXXX"
	SKP
TT2	LAC	(MES3)	/PACK "NONEX MEM REF, PC = X XXXXX"
	JMS	PSM
/
	LAC*	X10
	JMS	PPC
/
	LAC	(MES6)	/PACK ", AC = XXXXXX"
	JMS	PSM
	LAC*	X10
	JMS	POW
/
	LAC	(MES7)	/PACK ", XR = XXXXXX"
	JMS	PSM
	LAC*	X10
	JMS	POW
/
	JMP	WRITE
/
TT3	LAC	(MES4)	/PACK "BAD CAL AT PC = X XXXXX"
	JMS	PSM
	LAC*	X10
	JMS	PPC
	JMP	WRITE
/
TT4	LAC	(MES8)	/PACK "ABORTED; YET TRANSFERS PENDING COUNT
	JMS	PSM	/ = XXXXXX"
	LAC*	X10
	JMS	POW
/
WRITE	LAC	(015)	/TERMINATE LINE
	JMS	PSC
	LAC	(012)
	JMS	PSC
	CLA
	JMS	PSC
	LAC	CHCT
	RCR
	SWHA
	TAD	(001003)
	DAC	LINE
/
	CAL	WRCPB
	CAL	WFCPB
/
RETURN	LAC	(POOL)	/RETURN NODE TO POOL
	DAC*	(R1)
	LAC	NADR
	DAC*	(R2)
	JMS*	(NADD)
/
	JMP	PTN
/
/
/ PSM -- SUBROUTINE TO PACK .SIXBT MESSAGE WHOSE ADDRESS IS IN AC
/
PSM	0
	AAC	-1
	DAC*	(X12)
/
PSM1	LAC*	X12
	SAD	(-1)
	JMP*	PSM
	JMS	PSW
	JMP	PSM1
/
/
/ PSW -- SUBROUTINE TO PACK THE .SIXBT WORD IN AC
/
PSW	0
	LMQ
	JMS	PSWS
	JMS	PSWS
	JMS	PSWS
	JMP*	PSW
/
PSWS	0
	CLA
	LLS	6
	SNA
	JMP*	PSWS
	XOR	(40)
	TAD	(40)
	JMS	PSC
	JMP*	PSWS
/
/ POW -- SUBROUTINE TO PACK THE OCTAL WORD IN AC
/
POW	0
	LMQ
	LAW	-6
	DAC	POWC
/
POW1	CLA
	LLS	3
	XOR	(60)
	JMS	PSC
	ISZ	POWC
	JMP	POW1
	JMP*	POW
/
POWC	0
/
/ PPC -- SUBROUTINE TO PACK THE "PC" IN AC
/
PPC	0
	LMQ
	LAW	-5
	DAC	PPCC
/
	CLA
	LLS	3
	XOR	(60)
	JMS	PSC
	LAC	(040)
	JMS	PSC
/
PPC1	CLA
	LLS	3
	XOR	(60)
	JMS	PSC
	ISZ	PPCC
	JMP	PPC1
	JMP*	PPC
/
PPCC	0
/
/ PSC -- SUBROUTINE TO PACK THE SEVEN BIT CHARACTER IN AC
/
PSC	0
	DAC*	X13
	ISZ	CHCT
	JMP*	PSC
/
CHCT	0	/CHARACTER COUNT
NADR	0	/NODE ADDRESS
EV	0
/
WRCPB	2700		/"WRITE" CPB.
	EV
	LUN
	3		/IMAGE ALPHA MODE.
	LINE
/
WFCPB	20		/"WAITFOR" CPB.
	EV
/
MES1	.SIXBT	/*** "@------", /
	-1
MES2	.SIXBT	"MEM PROTECT ERR, PC = "
	-1
MES3	.SIXBT	"NONEX MEM REF, PC = "
	-1
MES4	.SIXBT	"BAD CAL AT PC = "
	-1
MES6	.SIXBT	", AC = "
	-1
MES7	.SIXBT	", XR = "
	-1
MES8	.SIXBT	"ABORTED; YET TRANSFERS PENDING COUNT = "
	-1
/
LINE	002003
	000000
	.BLOCK 130
/
	.END
