42_libasm/ft_strcmp.asm

19 lines
305 B
NASM
Raw Normal View History

2024-08-07 11:42:16 -04:00
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