42_libasm/ft_strlen.asm

13 lines
206 B
NASM

section .text
global ft_strlen
ft_strlen:
mov rcx, 0
loop:
cmp BYTE [rdi + rcx], 0
je out
inc rcx
jmp loop
out:
mov rax, rcx
ret