	.TITLE	IGPI
/
/  7 MAR 72 - MOD BY P. HENDERSON
/
/INITIALIZE GENERAL PURPOSE INTERRUPT
/      SUBROUTINE
/EXECUTION TIME:  76 (GPI0) OR 77 (GPI1-7)
/                 MICROSECONDS
/CALLING SEQUENCE:
/     CALL IGPI(NUMBER,HANDLER,ERROR)
/     NUMBER: 0-7 GPI NUMBER
/     HANDLER: PARAMETERLESS FORTRAN IV
/              SUBROUTINE NAME
/              (GPI HANDLER)
/     ERROR=0: NO ERROR
/          =1: ILLEGAL GPI REQUESTED
/}
	.GLOBL IGPI
	.GLOBL %GPI0,%GPI1,%GPI2,%GPI3
	.GLOBL %GPI4,%GPI5,%GPI6,%GPI7
/
IGPI	XX
	.ARG	IGPI
	DAC NUMBER  /REQUESTED NUMBER
	.ARG
	LMQ         /USER ADDRESS
	.ARG
	DAC ERROR   /ERROR LOCATION
	DZM* ERROR  /ERROR=0
	LAC* NUMBER
	AND (777770
	SZA
	JMP ERROR1	/NUMBER<0 OR >7
	LAC* NUMBER	/NUMBER
	TAD (XCT TABLE	/JMP GPI(NUMBER)
	DAC .+1
	XX	/ENABLE GPI(NUMBER)
GPI7	LACQ
	DAC* %GPI7  /USER ADDR.
	LAC (JMS* 35
	DAC* (70    /API TRANSFER
	LAC (002000
	JMP EXIT
GPI6	LACQ
	DAC* %GPI6  /USER ADDR.
	LAC (JMS* 34
	DAC* (67    /API TRANSFER
	LAC (004000
	JMP EXIT
GPI5	LACQ
	DAC* %GPI5  /USER ADDR.
	LAC (JMS* 27
	DAC* (66    /API TRANSFER
	LAC (010000
	JMP EXIT
GPI4	LACQ
	DAC* %GPI4  /USER ADDR.
	LAC (JMS* 26
	DAC* (65    /API TRANSFER
	LAC (020000
	JMP EXIT
GPI3	LACQ
	DAC* %GPI3  /USER ADDR.
	LAC (JMS* 25
	DAC* (64    /API TRANSFER
	LAC (040000
	JMP EXIT
GPI2	LACQ
	DAC* %GPI2  /USER ADDRESS
	LAC (JMS* 24
	DAC* (63    /API TRANSFER
	LAC (100000
	JMP EXIT
GPI1	LACQ
	DAC* %GPI1  /USER ADDRESS
	LAC (JMS* 23
	DAC* (62    /API TRANSFER
	LAC (200000
	JMP EXIT
GPI0	LACQ
	DAC* %GPI0  /USER ADDRESS
	LAC (JMS* 22
	DAC* (71    /API TRANSFER
	LAC (400000
EXIT	IOT3
	JMP .-1
	RIMB        /RESTORE INTERRUPT
	            /MASK BITS
	JMP* IGPI
ERROR1	ISZ* ERROR  /ILL. GPI REQ.
	JMP* IGPI
ERROR
NUMBER
IOT3=703003
RIMB=703606
TABLE	JMP GPI0
	JMP GPI1
	JMP GPI2
	JMP GPI3
	JMP GPI4
	JMP GPI5
	JMP GPI6
	JMP GPI7
	.END
