xref: /csrg-svn/lib/libc/tahoe/string/strcmp.s (revision 61190)
134438Sbostic/*
2*61190Sbostic * Copyright (c) 1988, 1993
3*61190Sbostic *	The Regents of the University of California.  All rights reserved.
434438Sbostic *
542644Sbostic * %sccs.include.redist.c%
634824Sbostic *
734438Sbostic * This code is derived from software contributed to Berkeley by
834438Sbostic * Computer Consoles Inc.
934438Sbostic */
1029699Ssam
1134438Sbostic#if defined(LIBC_SCCS) && !defined(lint)
12*61190Sbostic	.asciz "@(#)strcmp.s	8.1 (Berkeley) 06/04/93"
1334438Sbostic#endif /* LIBC_SCCS and not lint */
1434438Sbostic
1529699Ssam#include "DEFS.h"
1629699Ssam
1729699Ssam/*
1829699Ssam * Compare strings:  s1>s2: >0  s1==s2: 0  s1<s2: <0
1929699Ssam *
2029699Ssam * strcmp(s1, s2)
2129699Ssam * register char *s1, *s2;
2229699Ssam*/
2329699Ssam
2429699SsamENTRY(strcmp, 0)
2529699Ssam	movl	4(fp),r0
2629699Ssam	movl	8(fp),r1
2729699Ssam	cmps2
2829699Ssam	jgtr	greater
2929699Ssam	jlss	less
3029699Ssamequal:	clrl	r0
3129699Ssam	ret
3229699Ssamless:	movl	$-1,r0
3329699Ssam	ret
3429699Ssamgreater: movl	$1,r0
3529699Ssam	ret
36