	.TITLE TIME10
/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ .... EDIT #6 .... 4 MAR 70
/
/SUBROUTINE TO DO TIMINGS IN MINUTES,
/	 SECONDS, AND TENTHS OF SECONDS
/
/CALLING SEQUENCE
/	.GLOBL	TIME10
/	JMS*	TIME10
/	JMP	.+5
/	.DSA	IMIN		/MINUTE REG
/	.DSA	ISEC		/SECOND REG
/	.DSA	ISEC10		/TENTH SECOND SWITCH
/	.DSA	IOFF		/OFF SWITCH
/
/SET IOFF TO NON-ZERO TO TURN TIME OFF
	/DEFINE BF=0 FOR BF MONITOR
	/DEFINE CY50%=0 FOR 50 HZ
/
CLON=700044
/
	.GLOBL	TIME10,.DA
TIME10	0
	JMS*	.DA
	JMP	.+5
IMIN	0			/MINUTES
ISEC	0			/SECONDS
ISEC10	0			/TENTH SECOND
IOFF	0			/OFF SWITCH
	.IFDEF	BF
	CAL	1000		/ABORT .TIMER
	14			/WHICH MAY BE IN
	TIMOUT			/PROGRESS TO TIMOUT.
	.DEC
	-60			/INTERVAL IS IMMATERIAL.
	.OCT
	DZM	TIMOUT		/CLEAR ENTRY POINTS IN
	DZM	TIM2		/CASE OF PROGRAM RESTART.
	.ENDC
	DZM*	IMIN
	DZM*	ISEC
	DZM*	ISEC10
	DZM*	IOFF
	.DEC
	LAW	-10
	.OCT
	DAC	SEC#
	.DEC
	LAW	-60
	.OCT
	DAC	MIN#		/SET MINUTE OVERFLOW
	.IFUND CY50%
	.TIMER	6,TIMOUT
	.ENDC
	.IFDEF CY50%
	.TIMER 5,TIMOUT
	.ENDC
	JMP*	TIME10
TIMOUT	0
	DAC	ACSAV#
	ISZ*	ISEC10		/INCREMENTS 10TH 
	ISZ	SEC
	JMP	SECJ		/STILL 10THS
	DZM*	ISEC10
	.DEC
	LAW	-10
	.OCT
	DAC	SEC
	ISZ*	ISEC		/INCREMENT SEC
	ISZ	MIN
	JMP	SECJ		/STILL SECONDS
	ISZ*	IMIN
	DZM*	ISEC
	.DEC
	LAW	-60
	.OCT
	DAC	MIN
SECJ	LAC*	IOFF		/TURN IT OFF?
	SZA
	JMP	CLOFJ		/YES
	.IFDEF	BF
	LAC	TIM2		/CHECK REAL TIME SUBR. ENTRY PT.
	SNA
	JMP	.+4		/REAL TIME SUBR. ACTIVE
	LAC	(JMP TIMRES	/SET REAL TIME SUBR. EXIT
	DAC	TIMXIT
	JMP	CLOFJ
	LAC	TIMOUT		/GET ADDRESS
	DAC	TIM2
	LAC	(TIM2+1
	DAC	TIMOUT		/SET EXIT FOR TIM2+1
CLOFJ	LAC	ACSAV
/	.RLXIT	TIMOUT
	CAL	TIMOUT
	20
TIM2	0
	DAC	AC2#
TIMRES	LAC	(CAL TIM2	/RESET .RLXIT
	DAC	TIMXIT
	.IFUND	CY50%
	.TIMER	6,TIMOUT
	.ENDC
	.IFDEF	CY50%
	.TIMER	5,TIMOUT
	.ENDC
	LAC	AC2
TIMXIT	CAL	TIM2		/.RLXIT TIM2
	20
	.END
	.ENDC
	.IFUND	BF
	.DEC
	.IFUND CY50%
	LAW	-6
	.ENDC
	.IFDEF CY50%
	LAW -5
	.ENDC
	.OCT
	DAC*	(7		/SET UP CLOCK
	LAC	TIMOUT
	RAL			/RESTORE LINK
	LAC	ACSAV		/RESTORE AC
	CLON
	JMP*	TIMOUT		/RETURN
CLOFJ	LAC	TIMOUT
	RAL			/RESTORE LINK
	LAC	ACSAV		/RESTORE AC
	JMP*	TIMOUT		/RETURN
	.END
	.ENDC
