.title equal ; ; this routine implements the following interface ; ; status = equal(a, b) ; ; a and b are EOS-terminated strings ; if equal, return(YES[1]) else return(NO[0]) ; a=4 b=8 yes=1 no=0 .psect st_pure_code rel,con,lcl,exe,nowrt,rd,pic,shr,usr,novec,long .entry equal ^m movl a(ap),r1 ; address of a(1) movl b(ap),r2 ; address of b(1) movl #no,r0 ; assume not equal 10$: cmpb (r1)+,(r2) ; compare next character bneq 20$ ; not equal, return tstb (r2)+ ; is this EOS (0)? bneq 10$ ; no, try again movl #yes,r0 ; return(YES) 20$: ret .end