xref: /original-bsd/lib/libc/tahoe/string/strcmp.s (revision 25342562)
1/*
2 * Copyright (c) 1988, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Computer Consoles Inc.
9 */
10
11#if defined(LIBC_SCCS) && !defined(lint)
12	.asciz "@(#)strcmp.s	8.1 (Berkeley) 06/04/93"
13#endif /* LIBC_SCCS and not lint */
14
15#include "DEFS.h"
16
17/*
18 * Compare strings:  s1>s2: >0  s1==s2: 0  s1<s2: <0
19 *
20 * strcmp(s1, s2)
21 * register char *s1, *s2;
22*/
23
24ENTRY(strcmp, 0)
25	movl	4(fp),r0
26	movl	8(fp),r1
27	cmps2
28	jgtr	greater
29	jlss	less
30equal:	clrl	r0
31	ret
32less:	movl	$-1,r0
33	ret
34greater: movl	$1,r0
35	ret
36