From 6126cb3f4173ae8e440b35e02e166a5c86378db0 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 19 Nov 2020 19:40:03 +0000 Subject: In progress FossilOrigin-Name: 0e3af2b7fdaa117d45dd21f15813cadbb0a59c81 --- src/u_strlen.S | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/u_strlen.S (limited to 'src/u_strlen.S') 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 -- cgit v1.2.3