	.TITLE TIME
	.GLOBL TIME,%ENTER,%START,%STOP
/START THE FORTRAN CLOCK SUBROUTINE
/EXECUTION TIME:  AT LEAST 129 MICROSECONDS
/CALLING SEQUENCE:  CALL TIME(CYCLE,SEC10,SECOND,MINUTE,SWITCH)
/   CYCLE:  FORTRAN VARIABLE TO BE ASSIGNED THE
/           60 CYCLE PER SECOND COUNT
/   SEC10:  FORTRAN VARIABLE TO BE ASSIGNED
/           THE TENTHS-OF-A-SECOND ELAPSED TIME
/   SECOND:  FORTRAN VARIABLE TO BE ASSIGNED
/            THE SECONDS OF ELAPSED TIME
/   MINUTE:  FORTRAN VARIABLE TO BE ASSIGNED
/            THE MINUTES OF ELAPSED TIME
/   SWITCH:  CLOCK IS STOPPED (CYCLE COUNT AND
/            ELAPSED TIME ARE FROZEN) WHEN SWITCH
/            IS SET TO ANY NON-ZERO VALUE
/NOTE:  ALL ARGUMENTS ARE FORTRAN IV INTEGER VARIABLES
TIME	0
	ISZ TIME
	LAC* TIME
	DAC CYCLE
	SPA
	LAC* CYCLE	/INDIRECT
	DAC CYCLE
	DZM* CYCLE	/CYCLES=0
	LAW 17772
	DAC MCYCLE	/INITIALIZE CYCLE COUNTER
	ISZ TIME
	LAC* TIME
	DAC SEC10
	SPA
	LAC* SEC10	/INDIRECT
	DAC SEC10
	DZM* SEC10	/TENTHS=0
	LAW 17766
	DAC MSEC10	/INITIALIZE TENTHS COUNTER
	ISZ TIME
	LAC* TIME
	DAC SECOND
	SPA
	LAC* SECOND	/INDIRECT
	DAC SECOND
	DZM* SECOND	/SECONDS=0
	LAW 17704
	DAC MSEC	/INITIALIZE SECOND COUNTER
	ISZ TIME
	LAC* TIME
	DAC MINUTE
	SPA
	LAC* MINUTE	/INDIRECT
	DAC MINUTE
	DZM* MINUTE	/MINUTES=0
	ISZ TIME
	LAC* TIME
	DAC SWITCH
	SPA
	LAC* SWITCH
	DAC SWITCH	/SWITCH LOCATION
	ISZ TIME	/BUMP TO EXIT
FIXLOC	JMS* %START	/START THE CLOCK
	LAC (1	/1/60 SECOND
	JMS* %ENTER	/REQUEST NOTIFICATION
	CLOCK
	LAC .+2
	DAC FIXLOC	/BYPASS START-UP CODE
	JMP* TIME
CLOCK	0
	LAC* SWITCH
	SNA
	JMP CLKOFF	/TIME TO STOP THE CLOCK
	ISZ* CYCLE	/INCREMENT CYCLES
	ISZ MCYCLE
	JMP EXIT
	LAW 17772	/ONE-TENTH OF A SECOND COMPLETED
	DAC MCYCLE	/RESET CYCLE COUNTER
	ISZ* SEC10	/INCREMENT TENTHS
	ISZ MSEC10
	JMP EXIT
	DZM* SEC10	/ONE SECOND COMPLETED -- TENTHS=0
	LAW 17766
	DAC MSEC10	/RESET TENTHS COUNTER
	ISZ* SECOND	/INCREMENT SECONDS
	ISZ MSEC
	JMP EXIT
	LAW 17704	/ONE MINUTE COMPLETED
	DZM* SECOND	/SECONDS=0
	DAC MSEC	/RESET SECOND COUNTER
	ISZ* MINUTE	/INCREMENT MINUTES
EXIT	LAC (1	/EVERY 1/60 SECOND
	JMS* %ENTER	/REQUEST NOTIFICATION AGAIN
	CLOCK
	JMP* CLOCK
CLKOFF	JMS* %STOP	/STOP THE CLOCK
	LAC (JMS* %START
	DAC FIXLOC	/RESET START-UP CODE
	JMP* CLOCK
MCYCLE	-6
MSEC10	-12
MSEC	-74
CYCLE
SEC10
SECOND
MINUTE
SWITCH
	.END
