libasm/ft_strcmp.s

21 lines
283 B
ArmAsm
Raw Normal View History

2024-02-24 08:38:29 +00:00
global ft_strcmp
ft_strcmp:
xor rdx, rdx
2024-02-24 08:38:29 +00:00
xor rax, rax
.loop:
mov al, [rsi + rdx]
cmp byte [rdi + rdx], al
2024-02-24 08:38:29 +00:00
jne .done
cmp byte [rdi + rdx], 0
je .done
inc rdx
jmp .loop
.done:
xor rax, rax
xor rbx, rbx
2024-02-26 04:47:24 +00:00
mov al, byte [rdi + rdx]
mov bl, byte [rsi + rdx]
2024-02-24 08:38:29 +00:00
sub rax, rbx
ret