	.bss
	.comm	msg, 24

! BP not needed
	.text
	.globl	close
close:
	mov	bx, sp		! cannot use SP directly
	mov	ax, [bx + 2]
	mov	[msg + 4], ax	! file descriptor
	mov	byte ptr [msg + 2], #6	! CLOSE system call number
	mov	ax, #1		! ax = FS (== 1)
	mov	bx, msg
	mov	cx, #3		! BOTH == 3. sendrec(srcdest, ptr).
	int	#32		! trap to the kernel
	test	ax, ax
	jnz	close.return	! sendrec() itself has failed
	or	ax, [msg + 2]	! return value
close.return:
	ret
