	.title	homdir - return home directory spec to user
;+
;	subroutine homdir(buf)
;
;	the home directory spec is returned to the user as a 0-byte
;	terminated string in buf
;
;	this routine depends upon the corrections to DRGTK, SPROVFDT
;	and HELLO published in the multi-tasker
;-
ap=%5
buf=2
	.mcall	gtsk$s
	.psect	$r.rod,con,ro,rel,lcl,d
device:	.asciz	"HO:"
	.even
	.psect	$r.roi,con,ro,rel,lcl,i
	.enabl	lsb
homdir::
	sub	#32.,sp			; space for GTSK buffer
	mov	sp,r0			; address of buffer
	gtsk$s	r0			; get task parameters
	mov	g.tsdu(r0),r3		; UIC to format
	add	#32.,sp			; restore stack
	mov	buf(ap),r2		; address of user's buffer
	mov	#device,r1		; source buffer
10$:
	movb	(r1)+,(r2)+		; copy character to buffer
	bne	10$			; if not null, go again
	tstb	-(r2)			; back up one byte
	clr	r4			; no leading zeroes, separators
	jsr	pc,.ppasc		; format UIC into buffer
	clrb	(r2)			; null terminate string
	return
	.end
