xref: /csrg-svn/lib/libc/tahoe/string/strcmp.s (revision 34438)
1/*
2 * Copyright (c) 1988 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Computer Consoles Inc.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that this notice is preserved and that due credit is given
10 * to the University of California at Berkeley. The name of the University
11 * may not be used to endorse or promote products derived from this
12 * software without specific prior written permission. This software
13 * is provided ``as is'' without express or implied warranty.
14 */
15
16#if defined(LIBC_SCCS) && !defined(lint)
17_sccsid:.asciz	"@(#)strcmp.s	1.2 (Berkeley) 05/23/88"
18#endif /* LIBC_SCCS and not lint */
19
20#include "DEFS.h"
21
22/*
23 * Compare strings:  s1>s2: >0  s1==s2: 0  s1<s2: <0
24 *
25 * strcmp(s1, s2)
26 * register char *s1, *s2;
27*/
28
29ENTRY(strcmp, 0)
30	movl	4(fp),r0
31	movl	8(fp),r1
32	cmps2
33	jgtr	greater
34	jlss	less
35equal:	clrl	r0
36	ret
37less:	movl	$-1,r0
38	ret
39greater: movl	$1,r0
40	ret
41