/ / Compare two character strings. / .globl strcmp / / strcmp(a, b) / char *a, *b; / Returns -1 if ab. / strcmp: mov 2(sp),r0 /Pick up `a' mov 4(sp),r1 /And `b' 0: cmpb (r0)+,(r1) /Are they the same bne 0f /No tstb (r1)+ /At the end of the string bne 0b /No clr r0 /Equal return return 0: blo 0f /Br if ab return return 0: mov $-1,r0 /A