reactos/reactos/lib/string/i386/memchr_asm.s
Christoph von Wittich f64f737e97 renamed some .S files (msvc fix)
svn path=/trunk/; revision=18797
2005-10-27 19:42:06 +00:00

31 lines
426 B
ArmAsm

/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/string/i386/memchr.s
*/
/*
* void* memchr(const void* s, int c, size_t n)
*/
.globl _memchr
_memchr:
push %ebp
mov %esp,%ebp
push %edi
mov 0x8(%ebp),%edi
mov 0xc(%ebp),%eax
mov 0x10(%ebp),%ecx
cld
repne scasb
je .L1
mov $1,%edi
.L1:
mov %edi,%eax
dec %eax
pop %edi
leave
ret