.title concat ; ; this routine implements the following fortran interface ; ; call concat(a, b, c) ; ; where a and b are EOS-terminated strings. a and b will be concatenated ; into c. a and c can be the same variables. ; ap=%5 a=2 b=4 c=6 .psect $r.roi,con,ro,rel,lcl,i .enabl lsb concat:: mov a(ap),r0 ; address of a(1) in r0 mov c(ap),r1 ; address of c(1) in r1 10$: movb (r0)+,(r1)+ ; copy this character bne 10$ ; while != EOS(0), do next one tstb -(r1) ; backup to EOS character in c mov b(ap),r0 ; address of b(1) in r0 20$: movb (r0)+,(r1)+ ; copy this character bne 20$ ; while != EOS(0), do next one return .end