	.TITLE	INIT
/
/  7 MAR 72 - MOD BY P. HENDERSON
/
/INITIALIZE SUBROUTINE
/EXECUTION TIME:  252 MICROSECONDS
/CALLING SEQUENCE:  CALL INIT(ERROR)
/   ERROR=0:  NO ERROR
/        =2:  CONSOLE FAILED TO SELECT
/
	.GLOBL INIT,%HALT,%HALTS
/
INIT	XX
	.ARG	INIT
	DAC ERROR	/ERROR LOCATION
	CLC
	IOT3
	JMP .-1
	SIMB	/MASK OFF INTERRUPTS
	LAC	(400377	/DE-SELECT ALL CONLSOLES;
	IOT3
	JMP	.-1	/ENABLE INTERRUPTS, CONSOLE 0
	CDIR
	LAC	(200
	IOT3
	JMP .-1
	CSIS	/SELECT CONSOLE 0
	LAC* (45
	DAC %HALT	/API HALT
	LAC* (112
	DAC %HALTS	/SOFT. HALT
	LAC (FAULT
	DAC* (36	/FAULT TRANSFER LOC.
	LAC (GPI0
	DAC* (22	/GPI0 TRANSFER LOC.
	LAC (GPI1
	DAC* (23	/GPI1 TRANSFER LOC.
	LAC (GPI2
	DAC* (24	/GPI2 TRANSFER LOC.
	LAC (GPI3
	DAC* (25	/GPI3 TRANSFER LOC.
	LAC (GPI4
	DAC* (26	/GPI4 TRANSFER LOC.
	LAC (GPI5
	DAC* (27	/GPI5 TRANSFER LOC.
	LAC (GPI6
	DAC* (34	/GPI6 TRANSFER LOC.
	LAC (GPI7
	DAC* (35	/GPI7 TRANSFER LOC.
	CLC
	IOT5
	JMP .-1
	ROCL	/RESET ALL CONTROL LINES
	LAW	-10
	DAC COUNT	/8 SENSE LINES
	LAC (XCT TABLE
	DAC .+3	/DEPOSIT RESET 0
	IOT5
	JMP .-1
	XX	/TEST AND RESET SENSE LINE
	ISZ .-1	/RESET +1
	ISZ COUNT
	JMP .-5	/RESET NEXT SENSE LINE
	IOT3
	JMP .-1
	RCSR	/READ CONSOLE SELECT
		/REGISTER
	DZM* ERROR	/ERROR=0
	SAD (000200
	JMP*	INIT
	LAC (2	/CONSOLE SELECT FAIL
	DAC* ERROR	/ERROR=2
	JMP* INIT
%HALT
%HALTS
COUNT
ERROR
TABLE	TSL0
	TSL1
	TSL2
	TSL3
	TSL4
	TSL5
	TSL6
	TSL7
IOT3=703003
IOT5=703005
CSIS=705326
RCSR=705333
SIMB=705006
CDIR=703426
ROCL=705306
TSL0=705013
TSL1=705113
TSL2=705213
TSL3=705313
TSL4=703413
TSL5=703513
TSL6=703613
TSL7=703713
	.EJECT
/FAULT INTERRUPT HANDLER
/EXECUTION TIME:  37 (NULL FAILURE),
/                 41 (DVM OVERRANGE),
/                 OR 42 (680 OVERLOAD)
/                 MICROSECONDS +
/                 USER SUBROUTINE
	.GLOBL %OVLD,%RANGE,%NULL
FAULT	0
	EEM	/ENABLE EXTEND MODE
	DAC ACKEEP	/SAVE AC
	LACQ
	DAC MQKEEP	/SAVE MQ
	IOT3
	JMP .-1
	RFW	/READ FAULT WORD
	SMA
	JMP EXIT	/NO FAULT HIGH
	RTL
	SMA
	JMP .+3
	JMS* %NULL	/NULL FAILURE
	JMP EXIT
	AND (020000
	SNA
	JMP .+3
	JMS* %RANGE	/DVM OVERRANGE
	JMP EXIT
	SZL
	JMS* %OVLD	/680 OVERLOAD
		/NO FAULT HIGH
EXIT	LAC MQKEEP
	LMQ	/RESTORE MQ
	LAC ACKEEP	/RESTORE AC
	DBR
	JMP* FAULT	/RELEASE 0
ACKEEP
MQKEEP
%NULL
%OVLD
%RANGE
RFW=705313
	.EJECT
/GENERAL PURPOSE INTERRUPT HANDLERS
/EXECUTION TIME:  25 MICROSECONDS +
/                 USER SUBROUTINE
	.GLOBL %GPI0,%GPI1,%GPI2,%GPI3
	.GLOBL %GPI4,%GPI5,%GPI6,%GPI7
GPI0	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI0	/EXEC. USER 0
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI0	/RELEASE 2
GPI1	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI1	/EXEC. USER 1
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI1	/RELEASE 2
GPI2	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI2	/EXEC. USER 2
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI2	/RELEASE 2
GPI3	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI3	/EXEC. USER 3
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI3	/RELEASE 2
GPI4	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI4	/EXEC. USER 4
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI4	/RELEASE 2
GPI5	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI5	/EXEC. USER 5
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI5	/RELEASE 2
GPI6	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI6	/EXEC. USER 6
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI6	/RELEASE 2
GPI7	0
	EEM	/ENABLE EXTEND MODE
	DAC SAVEAC	/SAVE AC
	LACQ
	DAC SAVEMQ	/SAVE MQ
	JMS* %GPI7	/EXEC. USER 7
	LAC SAVEMQ
	LMQ	/RESTORE MQ
	LAC SAVEAC	/RESTORE AC
	DBR
	JMP* GPI7	/RELEASE 2
SAVEAC
SAVEMQ
%GPI0
%GPI1
%GPI2
%GPI3
%GPI4
%GPI5
%GPI6
%GPI7
	.EJECT
/SOFTWARE INTERRUPT HANDLER
/EXECUTION TIME:  30 MICROSECONDS +
/                 USER SUBROUTINE
	.GLOBL %SOFT4,%SOFT5
	.GLOBL %SOFT6,%SOFT7
	.GLOBL %4SOFT,%5SOFT
	.GLOBL %6SOFT,%7SOFT
%4SOFT	0
	EEM	/ENABLE EXTEND MODE
	DAC KPAC4	/SAVE AC
	LACQ
	DAC KPMQ4	/SAVE MQ
	LAC %HALTS
	DAC* (112	/DISABLE 4
	JMS* %SOFT4	/EXEC. USER 4
	LAC KPMQ4
	LMQ	/RESTORE MQ
	LAC KPAC4	/RESTORE AC
	DBR
	JMP* %4SOFT	/RELEASE 4
KPAC4
KPMQ4
%5SOFT	0
	EEM	/ENABLE EXTEND MODE
	DAC KPAC5	/SAVE AC
	LACQ
	DAC KPMQ5	/SAVE MQ
	LAC %HALTS
	DAC* (113	/DISABLE 5
	JMS* %SOFT5	/EXEC. USER 5
	LAC KPMQ5
	LMQ	/RESTORE MQ
	LAC KPAC5	/RESTORE AC
	DBR
	JMP* %5SOFT	/RELEASE 5
KPAC5
KPMQ5
%6SOFT	0
	EEM	/ENABLE EXTEND MODE
	DAC KPAC6	/SAVE AC
	LACQ
	DAC KPMQ6	/SAVE MQ
	LAC %HALTS
	DAC* (114	/DISABLE 6
	JMS* %SOFT6	/EXEC. USER 6
	LAC KPMQ6
	LMQ	/RESTORE MQ
	LAC KPAC6	/RESTORE AC
	DBR
	JMP* %6SOFT	/RELEASE 6
KPAC6
KPMQ6
%7SOFT	0
	EEM	/ENABLE EXTEND MODE
	DAC KPAC7	/SAVE AC
	LACQ
	DAC KPMQ7	/SAVE MQ
	LAC %HALTS
	DAC* (115	/DISABLE 7
	JMS* %SOFT7	/EXEC. USER 7
	LAC KPMQ7
	LMQ	/RESTORE MQ
	LAC KPAC7	/RESTORE AC
	DBR
	JMP* %7SOFT	/RELEASE 7
KPAC7
KPMQ7
%SOFT4
%SOFT5
%SOFT6
%SOFT7
	.END
