/* strncmp.s 4.1 84/11/01 */
* Compare at most n characters of string
* s1 lexicographically to string s2.
movq 4(ap),r3 # r3 = s1; r4 = s2
locc $0,$65535,(r4) # look for '\0' in s2
cmpl r5,$65535 # n > chunk size?
movl r5,r1 # no, compare only n bytes
subl2 $65535,r5 # adjust n
cmpc3 $65535,(r4),(r3)# compare full block
jbr 1b # matched, next block
subl2 r4,r1 # calculate length
bleq 5f # yes, compare full string
movl r5,r1 # no, compare only n bytes
cmpc3 r1,(r4),(r3) # compare remainder
subb3 (r1),(r3),r0 # r0 = *s1 - *s2