Compucolor.org – Virtual Media

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

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;	GET THE DATE AS MM/DD/YY
;
	TITLE	GTDATE
;
;	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
;
MONTH	EQU	81BCH
DAY	EQU	81BDH
YEAR	EQU	81BEH	;YEAR IS LAST TWO DIGITS ONLY

	ENTRY	GTDATE

GTDATE:	MOV	A,M
	STA	TEMP
	LDA	MONTH	;CONVERT THE MONTH
	CALL	DECOUT
	DCX	H
	DCX	H
	LDA	TEMP
	MOV	M,A
	INX	H
	INX	H
	INX	H

	LDA	DAY	;CONVERT THE DAY
	CALL	DECOUT
	DCX	H
	DCX	H
	MVI	M,'/'	;PUT '/' BETWEEN MONTH AND DAY
	INX	H
	INX	H
	INX	H

	LDA	YEAR	;CONVERT THE YEAR
	CALL	DECOUT
	DCX	H
	DCX	H
	MVI	M,'/'	;PUT '/' BETWEEN DAY AND YEAR
	INX	H
	INX	H
	INX	H

	RET

TEMP:	DB	0

	END