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