fullpath PROC PASCAL 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
fullpath ENDP

getcwdd PROC PASCAL path:dword, disk:word
	push si
	push ds
	lds si,path
	mov dx,disk	; drive number (DL, 0 = default)
	mov ah,47h
	int 21h
	pop ds
	jc getcwdd_err
	mov ax,word ptr path
	mov dx,word ptr path+2
    getcwdd_end:
	pop si
	ret
    getcwdd_err:
	xor ax,ax
	cwd
	jmp getcwdd_end
getcwdd ENDP

