.title impath ;+ ; subroutine impath(path) ;- .psect $r.rod,con,ro,rel,lcl,d .enabl lc spath: .asciz "~usr/" .asciz "~bin/" .byte 12,0 spathl=.-spath .even .dsabl lc .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 #path,-(sp) ; want home directory in path format mov sp,r1 ; address of variable mov r1,-(sp) ; address of format variable mov r0,-(sp) ; address to place home directory in mov #2,-(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 cmp (sp)+,(sp)+ ; pop temporaries off stack 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