.title upper ;+ ; subroutine upper(buf) ; ; character buf(ARB) ; ; any characters found in the range A-Z are changed to the corresponding ; upper 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 upper ^m<> movl buf(ap),r1 ; address of buf(1) 10$: movzbl (r1),r0 ; fetch next character beql 20$ ; if == 0, done cmpb r0,#leta ; >= a? blss 30$ ; NO cmpb r0,#letz ; <= z? bgtr 30$ ; NO subl2 #dif,r0 ; make upper case 30$: movb r0,(r1)+ ; copy character back into string brb 10$ ; try again 20$: ret .end