minix/lib/nbsd_libc/arch/i386/string/bcmp.S
Gianluca Guida b6cbf7203b Import unmodified NetBSD libc in trunk
This patch imports the unmodified current version of NetBSD libc.
The NetBSD includes are in /nbsd_include, while the libc code itself is 
split between lib/nbsd_libc and common/lib/libc.
2011-02-14 19:36:03 +00:00

34 lines
521 B
ArmAsm

/*
* Written by J.T. Conklin <jtc@NetBSD.org>.
* Public domain.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: bcmp.S,v 1.9 2007/11/12 18:41:59 ad Exp $")
#endif
ENTRY(bcmp)
pushl %edi
pushl %esi
movl 12(%esp),%edi
movl 16(%esp),%esi
xorl %eax,%eax /* clear return value */
movl 20(%esp),%ecx /* compare by words */
shrl $2,%ecx
repe
cmpsl
jne L1
movl 20(%esp),%ecx /* compare remainder by bytes */
andl $3,%ecx
repe
cmpsb
je L2
L1: incl %eax
L2: popl %esi
popl %edi
ret