	.title	impath
;+
;	subroutine impath(path)
;-
	.psect	$r.rod,con,ro,rel,lcl,d
spath:
	.asciz	"~usr/"
	.asciz	"~bin/"
	.byte	12,0
spathl=.-spath
	.even
	.psect	$r.roi,con,ro,rel,lcl,i
	.enabl	lsb
ap=%5
path=2
impath::
	mov	path(ap),r0		; destination array address
	clrb	(r0)+			; EOS => search cwd first
	mov	r0,-(sp)		; address to place home directory in
	mov	#1,-(sp)		; one argument
	mov	sp,ap			; set up argument pointer
	jsr	pc,homdir		; fetch home directory
	tst	(sp)+			; remove argument count
	mov	(sp)+,r0		; address of start of home directory
20$:
	tstb	(r0)+			; at EOS yet?
	bne	20$			; NO
	mov	#spath,r1		; source array address
	mov	#spathl,r2		; length of array
10$:
	movb	(r1)+,(r0)+		; copy next character
	sob	r2,10$			; do again
	return
	.end
