/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/ EDIT #5
/
/ COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/ MCR FUNCTION: TIME         25 MAR 71          R. MCLEAN
/
/ TASK NAME:  "...TIM"   TO TYPE LUN-3  TIME ON THE
/  IN RESPONSE TO THE MCR "TIME" REQUEST.
/
/ THE FIRST LINE OF COMMAND INPUT FOR ANY MCR FUNCTION IS READ
/ BY THE RESIDENT MCR TASK ("...MCR").  FOR THE "TIME" FUNCTION,
/ THE SYNTAX OF THE FIRST LINE IS:
/
/	SYNTAX = "TIM"$<CHARACTER> <CR>/<AM>
/	    <CHARACTER> = <LETTER>/<DIGIT>
/	    <CR> = CAR RTN
/	    <AM> = ALTMODE
/	    $ "ANY NUMBER OF, INCLUDING ZERO"
/
/ THE RESIDENT MCR READS A LINE, FETCHES THE FIRST THREE CHARACTERS
/ TO FROM THE MCR FUNCTION TASK NAME ("...TIM"), FLUSHES CHARACTERS
/ THRU THE FIRST BREAK OR TERMINAL CHAR, REQUESTS "...TIM" AND EXITS.
/
/ LINE TERMINATOR.  NO DATA IS TAKEN FROM THE COMMAND INPUT LINE.
/ THE TASK "...TIM" FLUSHES ALL CHARACTERS THRU THE END OF THE INPUT LINE,
/ AND SAVES THE LINE TERMINATOR.  NO DATA IS TAKEN FROM THE INPUT LINE.
/
/ THE TIME IS TYPED OUT  "HH:MM:SS"
/
/ IF THE INPUT LINE IS TERMINATED BY A CAR RTN, THE RESIDENT MCR
/ IS REQUESTED, AND THE FUNCTION TASK EXITS.
/
/ IF THE INPUT LINE IS TERMINATED BY AN ALTMODE, THE FUNCTION
/ TASK ("...TIM") EXITS WITHOUT REQUESTING THE RESIDENT MCR.
/ A ^C TYPEIN IS NECESSARY TO RE-ESTABLISH MCR DIALOGUE.
 .TITLE *** MCR FUNCTION 'TIME'
/
SS=163
MM=164
HH=165
MCRRI=171
FAC=174
/
.INH=705522	/INHIBIT INTERRUPTS
.ENB=705521	/ENABLE INTERRUPTS
/
TIME	JMS*	(FAC)	/FLUSH INPUT THRU TERMINATOR, AND
	SAD	(015)
	JMP	TIM3
	SAD	(175)
	JMP	TIM3
	JMP	TIME
TIM3	DAC	TERM
/
	.INH		///FETCH  TIME
	LAC*	(HH)	///
	DAC	MHH	///
	LAC*	(MM)	///
	DAC	MMM	///
	.ENB		///
	LAC*	(SS)	///
	DAC	MSS
/
	LAC	(MHH)	/CONVERT TIME TO DECIMAL AND
	DAC	CONX	/STORE IN IMAGE ALPHA BUFFER
	JMS	CON
	JMS	CON
	JMS	CON
/
	CAL	TYPCPB	/TYPE TIME
	CAL	WAITLP	/WAIT FOR TTY TO FINISH
/
EXIT	LAC	TERM	/IF CAR RTN TERMINATED INPUT LINE, REQUEST
	SAD	(015)	/RESIDENT MCR TASK & EXIT.  IF ALTMODE TERMINATED
	CAL	REQMCR	/INPUT LINE, CLEAR ^C REQUEST INHIBIT FLAG
	SAD	(175)	/AND EXIT.
	DZM*	(MCRRI)
	CAL	(10)
/
TERM	0
/
WAITLP	20
	TYPEV	/EVENT VARIABLE ADDRESS
/
REQMCR	1		/REQUEST "...MCR" CPB
	0
	.SIXBT	"..."
	.SIXBT	"MCR"
	0
/ CON -- SUBROUTINE TO CONVERT AN INTEGER TO ITS TWO DIGIT
/ DECIMAL EQUIVALENT (IMAGE ALPHA).  'CONX' POINTS TO THE
/ BINARY WORD.  THE BINARY WORD IS REPLACED BY THE TENS
/ DIGIT AND THE UNITS DIGIT IS STORED IN THE FOLLOWING WORD.
/ 'CONX' IS INCREMENTED BY THREE.
/
CON	0
	LAC*	CONX
	DZM*	CONX
CON1	DAC	CONB
	AAC	-12
	SPA
	JMP	CON2
	ISZ*	CONX
	JMP	CON1
CON2	LAC*	CONX
	XOR	(60)
	DAC*	CONX
	ISZ	CONX
	LAC	CONB
	XOR	(60)
	DAC*	CONX
	ISZ	CONX
	ISZ	CONX
	JMP*	CON
/
CONX	0
CONB	0
/
TYPCPB	2700	/FUNCTION
	TYPEV	/EV ADR
	3	/LUN
	3	/MODE
	MES12	/BUFFFER ADR
/
TYPEV	0	/EVENT VARIABLE
/
MES12	006003	/HEADER
	000000
MHH	000	/HOURS
	000
	072	/COLON
MMM	000	/MINUTES
	000
	072
MSS	000	/SECONDS
	000
	015	/CR
	012	/LF
/
	.END	TIME
