aboutsummaryrefslogtreecommitdiff
path: root/S/str_rchr.S
blob: 032c393c6c46239f542acc1f2315065a6352f1ba (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
.globl str_rchr
.type str_rchr, @function
str_rchr:
	pushl	%esi
	movl	8(%esp), %esi
	movb	12(%esp), %ah
	xorl	%ecx, %ecx
.L1:
	lodsb
	cmpb	%ah,%al
	jne	.L0
	movl	%esi, %ecx
.L0:
	testb	%al,%al
	jne	.L1

	testl	%ecx, %ecx
	jnz	.L3
	movl	%esi, %ecx
.L3:
	subl	8(%esp), %ecx
	leal	-1(%ecx), %eax
	popl	%esi
	ret