memchr.s - scc - simple c99 compiler
(HTM) git clone git://git.simple-cc.org/scc
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
memchr.s (220B)
---
1 .file "memchr.s"
2
3 .text
4 .globl memchr,_memchr
5 _memchr:
6 memchr:
7 cmpq $0,%rdx
8 je notfound
9
10 movq %rdx,%rcx
11 movb %sil,%al
12 cld
13 repne
14 scasb
15 je found
16
17 notfound:
18 xor %eax,%eax
19 ret
20
21 found:
22 leaq -1(%rdi),%rax
23 ret