	.TITLE	TIME LIMIT EXCEEDED PROCESSOR FOR  RSX/BATCH
/ 
/ 
/                   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
/	TLE FUNCTION TASK
/	EDIT #1 1/30/74 G. COLE
/
/
/THIS ROUTINE ACTS ACCORDING TO THE FLAGS TLEMOD AND TLEACT
/WHICH ARE IN THE BATCH CONTROL VECTOR IN RSX/BATCH.
/
/TLEMOD IS 0 WHEN THE JOB HAS NOT REACHED ITS ESTIMATED
/	RUN TIME.
/TLEMOD IS 1 AFTER IT HAS REACHED ITS ESTIMATED RUNTIME BUT
/	BEFORE IT HAS REACHED TIME LIMIT EXCEEDED.
/TLEMOD IS LEFT 1 UNTIL ANOTHER JOB IS STARTED
/
/WHEN TLE COMES IN FOR PAHSE 1(ESTIMATE) IT PRINTS
/ ***OVERRUN***<BELL><BELL><BELL><BELL><BELL> ONTO THE
/OPR DEVICE (LUN64)
/
/THIS TASK IS RUN BY THE JOB PROCESSOR TO EXECUTE
/AT THE END OF THE ESTIMATED RUNTIME. IT THEN RERUNS ITSELF
/FOR 30 SECONDS LATER AFTER SETTING TLEMOD TO 1. THIS
/DEFINES THE ACTUAL JOB TIME LIMIT.
/
/WHEN THE TLE TSK EXECUTES AGAIN, IT USES TLEACT TO
/DETERMINE WHAT TO DO.
/	IN ALL CASES IT PRINTS ***TIME LIMIT EXCEEDED ONTO
/	THE LISTING DEV (LUN16) AND THE OPR DEV (LUN64)
/
/	IF TLEACT=1 IT REQUESTS AB.OPR AND EXITS
/	IF TLEACT=3 IT SETS JOBFND IN THE BCV TO -1 AND EXITS
/	IF TLEACT IS OTHER IT EXITS(ROOM FOR FUTURE FEATURES)
/
/
/
	.EJECT
BCV=147	/POINTER IN SCOM TO BATCH CONTROL VECTOR IN BATPRO.
/
TLE	LAC*	(BCV)	/GOTO BCV
	SNA		/IS BATCH RUNNING?
	CAL	(10)	/NO, EXIT
	AAC	16	/OFFSET TO JOBFND
	DAC	TEMP
	LAC*	TEMP
	AAC	-1
	SZA		/SKIP IF JOB RUNNING(IE,OVERRUNABLE!)
	CAL	(10)	/NOTHING RUNNING!! QUIT NOW
	LAC*	(BCV)	/GET BCV ADDRESS
	AAC	21	/OFFSET TO TLEMOD
	DAC	TEMP
	LAC*	TEMP	/GET TLEMOD
	SZA		/TEST FOR ESTIMAT
	JMP	TLEXC	/NO, ITS EXCEEDED
 
TLEST	ISZ*	TEMP	/SET PHASE TWO
	CAL	WREST	/WRITE ***OVERRUN***
	CAL	WAIT
	CAL	RUNTLE	/RUN TLE IN 30SEC
	CAL	WAIT
	CAL	(10)	/EXIT
	.EJECT
TLEXC	CAL	WRITE	/PRINT TO LPT
	CAL	WAIT
	CAL	WRITE2	/TP OPR
	CAL	WAIT
	LAC*	(BCV)
	SNA
	CAL	(10)	/EXIT IF BATCH HAS STOPPED
	AAC	22	/OFFSET TO TLEACT
	DAC	TEMP
	LAC*	TEMP
	SAD	(1)
	JMP	TLEABT	/REQUEST AN ABORT
	SAD	(3)
	JMP	TLESTP	/REQUEST A STOP OF THE JOB
	CAL	(10)	/EXIT
	.EJECT
TLEABT	CAL	TLEABX
	CAL	(10)	/EXIT
 
TLEABX	1	/CPB TO REQUEST AB.OPR TO ABORT TASK
	0
	.SIXBT	/AB.OPR/
	0
 
TLESTP	LAC*	(BCV)
	SNA
	CAL	(10)	/THIS IS ALWAYS WISE ESPECIALLY WHEN IO
			/HAS GONE ON.
	AAC	16	/POINTER TO JOBFND FLAG
	DAC	TEMP
	LAW	-1	/SET JOBFND -1
	DAC*	TEMP
	CAL	(10)	/EXIT
	.EJECT
WREST	2700
	EV
	100
	2
	ESTM
ESTM	ESTM1-ESTM/2*1000+2
	0
	.ASCII	/***OVERRUN***/<7><7><7><7><7><15>
ESTM1=.
 
RUNTLE	3	/CPB TO RUN TLE IN 30 MORE SEC
		/EXCEEDED MESSAGE..
	EV
	.SIXBT	/TLE.../
	36	/30 SECONDS
	2	/SECONDS AS UNITS
	0
	0
	0
 
WRITE	2700
	EV
	100
	2
	LINE
 
WRITE2	2700
	EV
	20
	2
	LINE
 
LINE	LINE1-LINE/2*1000+2
	0
	.ASCII	/***TIME LIMIT EXCEEDED***/<15>
LINE1=.
/
TEMP	0	/GENERAL TEMPORARY FOR OFFSET BCV ADDRESSES
EV	0
 
WAIT	20
	EV
 
	.END	TLE
