42_libasm/ft_strcmp.asm
2024-08-07 17:42:16 +02:00

19 lines
305 B
NASM

section .text
global ft_strcmp
ft_strcmp:
mov rax, rdi
mov rbx, rsi
loop:
mov al, [rax]
mov bl, [rbx]
cmp al, bl
jne out
cmp al, 0
je out
inc rax
inc rbx
jmp loop
out:
sub rax, rbx
ret