From f4f9159a885a94ca7128f854633dc8ecdfb02f26 Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 28 Aug 2024 13:53:42 +0200 Subject: [PATCH] use right register for strlen --- ft_strlen.asm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ft_strlen.asm b/ft_strlen.asm index f388b3d..e70693c 100644 --- a/ft_strlen.asm +++ b/ft_strlen.asm @@ -2,11 +2,12 @@ global ft_strlen ft_strlen: - mov rax, 0 + mov rcx, 0 loop: - cmp BYTE [rdi + rax], 0 + cmp BYTE [rdi + rcx], 0 je out - inc rax + inc rcx jmp loop out: + mov rax, rcx ret \ No newline at end of file