include	clib.inc
include	wsub.inc
include	string.inc
include	malloc.inc

PPROC	wsopen, wsub:dword
	les	bx,wsub
	mov	ax,es:[bx.ws_maxfb]
	shl	ax,2
	push	ax
	push	ax
	call	malloc
	pop	cx
	les	bx,wsub
	mov	word ptr es:[bx.ws_fcb],ax
	mov	word ptr es:[bx.ws_fcb+2],dx
	jz	wsopen_end
	push	dx
	push	ax
	push	cx
	call	memzero
	inc	ax
    wsopen_end:
	ret
PEND	wsopen

	END
