include	clib.inc
include	string.inc
include	fblk.inc
include	wsub.inc

_TEXT	SEGMENT

wsearch proc dist pascal public uses si di wsub:dword, string:dword
	les bx,wsub
	mov cx,es:[bx.ws_count]
	lodso es:[bx.ws_fcb],si,di
      @@:
	mov ax,-1
	or cx,cx
	jz @F
	dec cx
	mov es,si
	les bx,es:[di]
	add di,4
	invoke stricmp, string, addr es:[bx.fb_name]
	jnz @B
	mov dx,es
	les bx,wsub
	mov ax,es:[bx.ws_count]
	sub ax,cx
	dec ax
      @@:
	ret
wsearch endp

_TEXT	ENDS

	END
