include	clib.inc
include	disk.inc
include	dos.inc

PPROC	_disk_init, drv:word
	push di
	mov di,drv
	invoke _disk_test, di
	.if ax == _DISK_NOSUCHDRIVE || ax == -1
	    invoke beep, 5, 7
	    invoke _disk_select, addr cp_selectdisk
	    .if ax
		dec ax
		invoke _disk_init, ax
		mov di,ax
	    .endif
	.endif
	mov ax,di
	pop di
	ret
PEND	_disk_init

_DATA	SEGMENT

cp_selectdisk db 'Select disk',0

_DATA	ENDS

	END
