.title otoc ; ; this routine implements the following fortran interface ; ; length = otoc(n, buf, size) ; ; where n is the number to convert to octal characters ; buf is the array to hold the characters ; size is the size of the buffer ; ; the value of otoc is the length of the string ; ; this conversion is performed with the $cbomg entry ; point in syslib on IAS and RSX ; ap=%5 num=2 buf=4 siz=6 ; ; .psect $r.rwd,con,rw,rel,lcl,d locbuf: .blkb 8. ; local buffer to format into ; ; .psect $r.roi,con,ro,rel,lcl,i .enabl lsb otoc:: mov #locbuf,r0 ; buffer address in r0 mov @num(ap),r1 ; number to format clr r2 ; leading zeroes not wanted call $cbomg ; format number clrb (r0) ; terminate with EOS clr r0 ; initialize count mov #locbuf,r1 ; input buf in r1 mov buf(ap),r2 ; output buf in r2 mov @siz(ap),r3 ; size of string in r3 10$: movb (r1)+,(r2)+ ; copy character beq 20$ ; EOS => done inc r0 ; increment char count sob r3,10$ ; if room, do another 20$: clrb -(r2) ; backup and place EOS return .end