.title unfold ; ; this routine implements the following fortran interface ; ; call unfold(buf) ; ; where buf is an EOS-terminated string ; ; unfold crunches all characters in the range a-z into unfold case ; ap=%5 buf=2 BIGA=101 BIGZ=132 LETA=141 LETZ=172 DIF=LETA-BIGA MASK=177 unfold:: mov buf(ap),r1 ; address of buf(1) in r1 10$: movb (r1),r0 ; next character into r0 beq 20$ ; if == 0, then done cmpb r0,#LETA&MASK ; see if >= a blt 30$ ; if <, then copy character back cmpb r0,#LETZ&MASK ; see if <= z bgt 30$ ; if >, then copy character back sub #DIF,r0 ; subtract 40(8) from character 30$: movb r0,(r1)+ ; copy byte back into string br 10$ 20$: return .end