20 lines
264 B
ArmAsm
20 lines
264 B
ArmAsm
|
global ft_strcmp
|
||
|
|
||
|
ft_strcmp:
|
||
|
xor rdx, rdx
|
||
|
xor rax, rax
|
||
|
.loop:
|
||
|
mov al, [rsi + rdx]
|
||
|
cmp byte [rdi + rdx], al
|
||
|
jne .done
|
||
|
cmp byte [rdi + rdx], 0
|
||
|
je .done
|
||
|
inc rdx
|
||
|
jmp .loop
|
||
|
.done:
|
||
|
movsx rax, byte [rdi + rdx]
|
||
|
movsx rbx, byte [rsi + rdx]
|
||
|
sub rax, rbx
|
||
|
ret
|
||
|
|