diff options
author | JozanLeClerc <JozanLeClerc@noemail.net> | 2020-11-19 19:40:03 +0000 |
---|---|---|
committer | JozanLeClerc <JozanLeClerc@noemail.net> | 2020-11-19 19:40:03 +0000 |
commit | 6126cb3f4173ae8e440b35e02e166a5c86378db0 (patch) | |
tree | 61d2c6def8a4e7e34236fe18e804e728e2cdea3a /src/u_strlen.S | |
parent | Pretty cool (diff) | |
download | bsdsetsid-6126cb3f4173ae8e440b35e02e166a5c86378db0.tar.gz bsdsetsid-6126cb3f4173ae8e440b35e02e166a5c86378db0.tar.bz2 bsdsetsid-6126cb3f4173ae8e440b35e02e166a5c86378db0.tar.xz bsdsetsid-6126cb3f4173ae8e440b35e02e166a5c86378db0.tar.zst bsdsetsid-6126cb3f4173ae8e440b35e02e166a5c86378db0.zip |
In progress
FossilOrigin-Name: 0e3af2b7fdaa117d45dd21f15813cadbb0a59c81
Diffstat (limited to 'src/u_strlen.S')
-rw-r--r-- | src/u_strlen.S | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/u_strlen.S b/src/u_strlen.S new file mode 100644 index 0000000..27d9663 --- /dev/null +++ b/src/u_strlen.S @@ -0,0 +1,16 @@ +.text +.globl u_strlen + +u_strlen: + movq %rdi, %rcx + +u_loop: + cmpb $0x0, (%rcx) + je u_ret + inc %rcx + jmp u_loop + +u_ret: + sub %rdi, %rcx + movq %rcx, %rax + retq |