include	clib.inc
include	time.inc

PPROC	dwtostr, buf:dword, date:word
	les	bx,buf
	mov	cx,'.'
	mov	ax,date
	and	ax,001Fh
	call	@putesbxal
	mov	es:[bx],cl
	inc	bx
	mov	ax,date
	shr	ax,5
	and	ax,000Fh
	call	@putesbxal
	mov	es:[bx],cl
	inc	bx
	mov	ax,date
	shr	ax,9
	add	ax,DT_BASEYEAR
	cmp	ax,2000
	jb	dwtostr_01
	sub	ax,2000
    dwtostr_00:
	call	@putesbxal
	mov	es:[bx],ch
	mov	dx,es
	mov	ax,word ptr buf
	ret
    dwtostr_01:
	sub	ax,1900
	jmp	dwtostr_00
PEND	dwtostr

	END
