add: strcmp

This commit is contained in:
starnakin 2024-08-29 17:24:40 +02:00
parent 4f2537b58f
commit ea247dce62

View File

@ -0,0 +1,25 @@
section .note.GNU-stack noalloc noexec nowrite progbits
section .text
global ft_strcmp
ft_strcmp:
mov rcx, 0
loop:
mov dl, [rsi + rcx]
mov bl, [rdi + rcx]
cmp bl, 0
je out
cmp bl, dl
jne out
inc rcx
jmp loop
out:
mov rax, 0
mov rbx, 0
mov bl, BYTE [rsi + rcx]
mov al, BYTE [rdi + rcx]
sub rax, rbx
ret