blob: ce1c105a23258461f326874455ba3b4b703a2d2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/* $OpenBSD: memchr.S,v 1.1 1997/11/04 19:08:13 chuck Exp $ */
/*
* 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.
*/
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
|