	.TITLE LTCH
/
/  8 MAR 72 - MOD BY P. HENDERSON
/
	.GLOBL LTCH,%START,%ENTER
/
/LOAD TIMER CONTINUOUSLY AND SET HANDLER SUBROUTINE
/EXECUTION TIME:  85 TO 100 MICROSECONDS
/CALLING SEQUENCE:  CALL LTCH(TIME,HANDLER,ERROR)
/   TIME:  POSITIVE INTEGER CLOCK INTERVAL
/          (IN UNITS OF 16 2/3 MILLISECONDS)
/   HANDLER:  PARAMETERLESS FORTRAN IV SUBROUTINE NAME
/             (CLOCK INTERRUPT HANDLER)
/   ERROR=0:  NO ERROR
/        =1:  TIME NOT > 0
/
LTCH	XX
	.ARG	LTCH
	DAC TIME	/INTERVAL LOCATION
	.ARG
	DAC HANDLER	/USER SUBROUTINE
	.ARG
	DAC ERROR
	DZM* ERROR	/ERROR=0
	LAC* TIME
	SPA!SNA
	JMP ERROR1	/TIME NOT > 0
	JMS* %START	/START THE CLOCK
	LAC* TIME	/DESIRED INTERVAL
	DAC TIME
	LAC TIME
	JMS* %ENTER	/NOTIFICATION REQUEST
	CLOCK
	JMP* LTCH
CLOCK	0
	LAC TIME	/EVERY DESIRED INTERVAL
	JMS* %ENTER	/REQUEST NOTIFICATION AGAIN
	CLOCK
	JMS* HANDLER	/TO USER
	JMP* CLOCK
ERROR1	ISZ* ERROR	/ILLEGAL TIME REQUESTED
	JMP* LTCH
TIME
HANDLER
ERROR
	.END
