.title slen ; ; ; this routine implements the following fortran interface ; ; n = slen(buf) ; ; where buf is a byte array and the string is terminated by a ; 0-byte. The length returned does not include the 0-byte. ; ap=%5 buf=2 slen:: mov buf(ap),r1 ; address of buf in r1 clr r0 ; initialize length to 0 10$: tstb (r1)+ ; see if this byte is 0(EOS) beq 20$ ; if so, return inc r0 ; increment length by 1 br 10$ 20$: return .end