	.title	f11hdr
;+
;	integer function f11hdr(desc, buf)
;-
ap=%5
desc=2
buf=4
	.mcall	fdof$l,nbof$l,qiow$s
	fdof$l
	nbof$l
	.psect	$r.roi,con,ro,rel,lcl,i
	.enabl	lsb
f11hdr::
	mov	@desc(ap),r1		; RFDB address
	mov	r.fdb(r1),r0		; FDB address
	movb	f.lun(r0),r1		; lun
	add	#f.fnb+n.fid,r0		; FID address
	clr	-(sp)			; end of attribute list
	mov	buf(ap),-(sp)		; address of 512 byte buffer for header
	mov	(pc)+,-(sp)		; read file header
	.byte	-12,0
	mov	sp,r2			; address of attribute list
	qiow$s	#io.rat,r1,r$ioef,,#r$iosb,,<r0,r2>	; read header
	bcs	10$			; c set => error
	tstb	r$iosb			; error?
	blt	10$			; YES
	mov	#ok,r0
	br	20$
10$:
	mov	#err,r0
20$:
	add	#6,sp			; restore stack
	return
	.end
