include	clib.inc
include	time.inc

PPROC	dwtolstr, string:DPTR, date:word
	MLES	bx,string
	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	dwtolstr_19
	sub	ax,2000
	mov	word ptr es:[bx],'02'
    dwtolstr_end:
	add	bx,2
	call	@putesbxal
	mov	es:[bx],ch
	mov	dx,es
	mov	ax,word ptr string
	ret
    dwtolstr_19:
	sub	ax,1900
	mov	word ptr es:[bx],'91'
	jmp	dwtolstr_end
PEND	dwtolstr

	END
