include	clib.inc
include	dir.inc

PPROC	fullpath, buf:dword, drv:word
	push	word ptr buf+2
	mov	ax,word ptr buf
	add	ax,3
	push	ax
	push	drv
	call	getcwdd
	or	ax,dx
	jz	fullpath_end
	mov	ax,drv
	or	ax,ax
	jz	fullpath_get
	add	al,'@'
	jmp	fullpath_drv
    fullpath_get:
	call	getdrv
	add	al,'A'
    fullpath_drv:
	les	bx,buf
	mov	ah,':'
	mov	es:[bx],ax
	mov	al,'\'
	mov	es:[bx+2],al
	mov	dx,es
	mov	ax,bx
    fullpath_end:
	ret
PEND	fullpath

	END
