diff --git a/ft_strcmp.s b/ft_strcmp.s index 2e7fc6a..6c8ff62 100644 --- a/ft_strcmp.s +++ b/ft_strcmp.s @@ -1,19 +1,20 @@ global ft_strcmp ft_strcmp: - xor rdx, rdx + xor rdx, rdx xor rax, rax .loop: mov al, [rsi + rdx] - cmp byte [rdi + rdx], al + cmp byte [rdi + rdx], al jne .done cmp byte [rdi + rdx], 0 je .done inc rdx jmp .loop .done: + xor rax, rax + xor rbx, rbx mov al, byte [rdi + rdx] mov bl, byte [rsi + rdx] sub rax, rbx ret -