Compucolor.org – Virtual Media

Listing of file='GTTIME.MAC;02' on disk='vmedia/asm_utility_3-sector.ccvf'

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;	GET THE TIME-OF-DAY AS HH:MM:SS
;
	TITLE	GTTIME
;
;	VALUES ON ENTRY:
;	   HL => BUFFER FOR INFO
;
;	RETURNS:
;	   HL => NEXT FREE CHARACTER IN BUFFER
;
;	DESTROYS:
;	   ALL REGISTERS
;
	EXTRN	DECOUT	;ROUTINE TO CONVERT A BYTE TO ASCII
;
;	THESE ADDRESSES ARE FOR BOTH V6.78 AND V8.79
;

HOUR	EQU	81BBH	;HOURS, MINS AND SECS OF REAL-TIME
MIN	EQU	81BAH	;   CLOCK
SEC	EQU	81B9H

	ENTRY	GTTIME

GTTIME:	MOV	A,M
	STA	TEMP
	LDA	HOUR	;CONVERT THE HOURS
	CALL	DECOUT
	DCX	H
	DCX	H
	LDA	TEMP
	MOV	M,A
	INX	H
	INX	H
	INX	H

	LDA	MIN	;CONVERT THE MINUTES
	CALL	DECOUT
	DCX	H
	DCX	H
	MVI	M,':'	;PUT ':' BETWEEN HOURS AND MINS
	INX	H
	INX	H
	INX	H

	LDA	SEC	;CONVERT THE SECONDS
	CALL	DECOUT
	DCX	H
	DCX	H
	MVI	M,':'	;PUT ':' BETWEEN MINS AND SECS
	INX	H
	INX	H
	INX	H

	RET

TEMP:	DB	0

	END