include	clib.inc
include	malloc.inc
include	string.inc
include	fblk.inc

PPROC	fballoc, fname:dword, ftime:word, fdate:word, fsize:dword, flag:word
	invoke	strlen,fname
	add	ax,size S_FBLK
	invoke	malloc,ax
	jz	@F
	add	ax,fb_name
	invoke	strcpy,dx::ax,fname
	sub	ax,fb_name
	mov	bx,ax
	mov	cx,flag
	mov	es:[bx].fb_flag,cx
	movmw   es:[bx].fb_time,ftime
	movmw   es:[bx].fb_date,fdate
	movmx	es:[bx].fb_size,fsize
	mov	ax,bx
      @@:
	ret
PEND	fballoc

	END
