memcmp.s 196 B

123456789101112131415161718
  1. TEXT memcmp(SB),$0
  2. MOVL n+8(FP),R0
  3. BEQ ret
  4. MOVL s1+0(FP),A2
  5. MOVL s2+4(FP),A1
  6. l1: CMPB (A1)+,(A2)+
  7. BNE neq
  8. SUBL $1,R0
  9. BNE l1
  10. RTS
  11. neq: BCS gtr
  12. MOVL $-1,R0
  13. RTS
  14. gtr: MOVL $1,R0
  15. ret: RTS