.title fold ;+ ; subroutine fold(buf) ; ; character buf(ARB) ; ; any characters found in the range A-Z are folded to the corresponding ; lower case character ;- buf=4 biga=65 bigz=90 leta=97 letz=122 dif=leta-biga .psect st_pure_code rel,con,lcl,exe,nowrt,rd,pic,shr,usr,novec,long .entry fold ^m<> movl buf(ap),r1 ; address of buf(1) 10$: movzbl (r1),r0 ; fetch next character beql 20$ ; if == 0, done cmpb r0,#biga ; >= A? blss 30$ ; NO cmpb r0,#bigz ; <= Z? bgtr 30$ ; NO addl2 #dif,r0 ; make lower case 30$: movb r0,(r1)+ ; copy character back into string brb 10$ ; try again 20$: ret .end