From e5e343ff58e09dd9ac6b2beb6e7c06936d2de3f0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 6 Dec 2025 19:55:18 +0100 Subject: [PATCH] feat(src/strlen): adding the ft_strlen function - The strlen function now working --- src/ft_strlen.s | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/ft_strlen.s diff --git a/src/ft_strlen.s b/src/ft_strlen.s new file mode 100644 index 0000000..f8f8406 --- /dev/null +++ b/src/ft_strlen.s @@ -0,0 +1,19 @@ +segment .note.GNU-stack + +section .text + global ft_strlen + +ft_strlen: + mov rax, 0 + cmp rdi, 0 + je .exit + jmp .loop + +.loop: + cmp BYTE [rdi + rax], 0 + je .exit + inc rax + jmp .loop + +.exit: + ret