fix(strcmp): set rax and rbx to 0 before cmp

This commit is contained in:
gbrochar 2024-03-10 06:20:10 +01:00
parent 62e5d095b6
commit 83d43c88fc
1 changed files with 4 additions and 3 deletions

View File

@ -12,8 +12,9 @@ ft_strcmp:
inc rdx inc rdx
jmp .loop jmp .loop
.done: .done:
xor rax, rax
xor rbx, rbx
mov al, byte [rdi + rdx] mov al, byte [rdi + rdx]
mov bl, byte [rsi + rdx] mov bl, byte [rsi + rdx]
sub rax, rbx sub rax, rbx
ret ret