/
/ VERSION 5A 4/28/77  PT
/
	FIELD1	ONQI
	0
	JMP	SETINT		/SET UP #INT INITIALLY
	ISZ	ONQI		/BUMP ARG POINTER
	ISZ	INTQ+1		/BUMP INTERRUPT Q POINTER
	IOF			/**
	DCA%	INTQ+1		/STICK IOT ONTO INT Q
	TAD	XSKP		/FOLLOWED BY A SKIP
	ISZ	INTQ+1
	DCA%	INTQ+1		/ONTO INT Q
	ISZ	ONQI		/SKIP FIRST WORD OF ADDR
	ISZ	INTQ+1
ONQISW,	TAD%	ONQI		/GET INT HANDLER ADDRESS
	ISZ	ONQI
	DCA%	INTADR+1	/ONTO ADDRESS STACK
	TAD	INTADR+1	/NOW MAKE JMS%
	AND	L177
	TAD	L4600
	DCA%	INTQ+1		/ONTO INT Q
	ISZ	INTADR+1
	ION			/::
	ISZ	IQSIZE		/ROOM FOR MORE ?
	JMP%	ONQI		/YES
	TAD	.-1		/NO, CLOSE OUT THESUBR
	DCA	ONQI+1
	JMP%	ONQI
SETINT,	TAD	ONQISW		/DO THIS PART ONLY ONCE
	DCA	ONQI+1
	CDF
	IOF			/**
	TAD	XSKP		/FIX UP #INT
	DCA%	XINT+1
	ISZ	XINT+1
	TAD	INTQ+1
	DCA%	XINT+1
	ISZ	XINT+1
	TAD	CIFCDF
	DCA%	XINT+1
	ION			/**
CIFCDF,	CDF CIF 10
	JMP	ONQI+1		/BACK TO ONQI
	EXTERN	#INT
XINT,	ADDR	#INT
INTQ,	ADDR	IHANDL
INTADR,	ADDR	IHADRS
IQSIZE,	-5
XSKP,	SKP
L177,	177
L4600,	4600
	CDF CIF
	JMP%	IHANDL
IHANDL,	0
	REPEAT 16
	JMP	IHANDL-2
IHADRS,	0;0;0;0;0

	ENTRY	ONQB
ONQB,	0
	JMP	SETBAK		/SETUP #IDLE
	TAD%	ONQB		/GET ADDRESS OF IDLE JOB
ONQBSW,	ISZ	ONQB
	DCA%	BAKADR+1	/STORE ONTO BACKROUND JOB Q
	TAD	BAKADR+1	/MAKE A JMS%
	ISZ	BAKADR+1
	AND	L177
	TAD	L4600
	ISZ	BAKQ+1
	DCA%	BAKQ+1
	ISZ	BQSIZE		/MORE ROOM ?
	JMP%	ONQB		/YES
	TAD	.-1		/NO, CLOSE THE DOOR
	DCA	ONQB+1
	JMP%	ONQB
SETBAK,	TAD	ONQBSW		/CLOSE OFF #IDLE INITIALIZATION
	DCA	ONQB+1
	CDF
	TAD	XSKP		/FIX UP #IDLE
	DCA%	XIDLE+1
	TAD	BAKQ+1
	ISZ	XIDLE+1
	DCA%	XIDLE+1
	ISZ	XIDLE+1
	TAD	CIFCDF
	DCA%	XIDLE+1
	CIF CDF 10
	JMP	ONQB+1
	EXTERN	#IDLE
XIDLE,	ADDR	#IDLE
BAKQ,	ADDR	BAKRND
BAKADR,	ADDR	BHADRS
BQSIZE,	-5
	CDF CIF
	JMP%	BAKRND
BAKRND,	0
	REPEAT	6
	JMP	BAKRND-2
BHADRS,	0;0;0;0;0
	END
