28 lines
427 B
ArmAsm
28 lines
427 B
ArmAsm
|
/*
|
||
|
* Written by Matthias Pfaller, 1996
|
||
|
* Public domain.
|
||
|
*/
|
||
|
|
||
|
#include <machine/asm.h>
|
||
|
|
||
|
/*
|
||
|
* void *
|
||
|
* memchr (const void *b, int c, size_t len)
|
||
|
* locate the first occurrence of c in string b.
|
||
|
*/
|
||
|
|
||
|
#if defined(LIBC_SCCS)
|
||
|
RCSID("$NetBSD: memchr.S,v 1.1 1996/09/24 09:29:57 matthias Exp $")
|
||
|
#endif
|
||
|
|
||
|
ENTRY(memchr)
|
||
|
enter [r4],0
|
||
|
movd B_ARG2,r0
|
||
|
movb B_ARG1,r4
|
||
|
movd B_ARG0,r1
|
||
|
skpsb u
|
||
|
bfc 0f
|
||
|
movd r1,r0
|
||
|
0: exit [r4]
|
||
|
ret 0
|