aboutsummaryrefslogtreecommitdiff
path: root/S/str_chr.S
blob: 5fec8b2a4b91db94dbff2610be9b95b5daf5a7e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.globl str_chr
.type str_chr, @function
str_chr:
	pushl	%esi
	movl	8(%esp), %esi
	movb	12(%esp), %ah
.L1:
	lodsb
	cmpb	%ah,%al
	je	.L2
	testb	%al,%al
	jne	.L1
.L2:	
	leal	-1(%esi), %eax
	subl	8(%esp), %eax
	popl	%esi
	ret