.title scopy ; ; this routine provides the following fortran interface ; ; call scopy(in, i, out, j) ; ; where in is an EOS-terminated string ; ap=%5 in=2 i=4 out=6 j=10 .psect $r.roi,con,ro,rel,lcl,i .enabl lsb scopy:: mov in(ap),r0 ; address of in(1) in r0 mov @i(ap),r1 ; value of i in r1 dec r1 ; now value of i-1 add r1,r0 ; r0 now has address of in(i) mov out(ap),r1 ; address of out(1) in r1 mov @j(ap),r2 ; value of j in r2 dec r2 ; now value of j-1 add r2,r1 ; r1 now has address of out(j) 10$: movb (r0)+,(r1)+ ; copy next byte bne 10$ ; if != 0, then do next byte return .end