feat(src/strlen): adding the ft_strlen function
- The strlen function now working
This commit is contained in:
parent
c62f86e057
commit
e5e343ff58
1 changed files with 19 additions and 0 deletions
19
src/ft_strlen.s
Normal file
19
src/ft_strlen.s
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue