1/*	$OpenBSD: strchr.S,v 1.8 2017/11/29 05:13:57 guenther Exp $ */
2/*
3 * Written by J.T. Conklin <jtc@netbsd.org>.
4 * Public domain.
5 */
6
7#include "DEFS.h"
8
9WEAK_ALIAS(index, strchr)
10
11ENTRY(strchr)
12	movl	4(%esp),%eax
13	movb	8(%esp),%cl
14	.align 2,0x90
15L1:
16	movb	(%eax),%dl
17	cmpb	%dl,%cl			/* found char??? */
18	je 	L2
19	incl	%eax
20	testb	%dl,%dl			/* null terminator??? */
21	jnz	L1
22	xorl	%eax,%eax
23L2:
24	ret
25END_STRONG(strchr)
26