Added commentary
This commit is contained in:
13
ft_strlen.s
13
ft_strlen.s
@@ -1,13 +1,12 @@
|
||||
global ft_strlen
|
||||
|
||||
ft_strlen:
|
||||
xor rax, rax
|
||||
xor rax, rax ; rax = 0;
|
||||
|
||||
.cmp_char:
|
||||
cmp byte [rdi + rax], 0
|
||||
je .end
|
||||
inc rax
|
||||
jmp .cmp_char
|
||||
|
||||
cmp byte [rdi + rax], 0 ; if (str[rax] == 0)
|
||||
je .end ; goto end
|
||||
inc rax ; rax++;
|
||||
jmp .cmp_char ; repeat
|
||||
.end:
|
||||
ret
|
||||
ret ; return it
|
||||
Reference in New Issue
Block a user