	.TITLE TIME
/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ .... EDIT #7 .... 4 MAR 70
/
/SUBROUTINE TO DO TIMINGS IN MINUTES
/	AND SECONDS
/
/CALLING SEQUENCE
/	.GLOBL	TIME
/	JMS*	TIME		/SIZE 42(DECIMAL)
/	JMP	.+4
/	.DSA	IMIN		/MINUTE REG
/	.DSA	ISEC		/SECOND REG
/	.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	TIME,.DA
TIME	0
	JMS*	.DA
	JMP	.+4
IMIN	0			/MINUTES
ISEC	0			/SECONDS
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*	IOFF
	.DEC
	LAW	-60
	.OCT
	DAC	MIN#		/SET MINUTE OVERFLOW
	.IFUND CY50%
	.TIMER	60,TIMOUT
	.ENDC
	.IFDEF CY50%
	.TIMER 50,TIMOUT
	.ENDC
	JMP*	TIME
TIMOUT	0
	DAC	ACSAV#
	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	60,TIMOUT
	.ENDC
	.IFDEF	CY50%
	.TIMER	50,TIMOUT
	.ENDC
	LAC	AC2
TIMXIT	CAL	TIM2		/.RLXIT TIM2
	20
	.END
	.ENDC
	.IFUND	BF
	.DEC
	.IFUND CY50%
	LAW	-60
	.ENDC
	.IFDEF CY50%
	LAW -50
	.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
