add: strcmp
This commit is contained in:
parent
4f2537b58f
commit
ea247dce62
@ -0,0 +1,25 @@
|
||||
section .note.GNU-stack noalloc noexec nowrite progbits
|
||||
section .text
|
||||
global ft_strcmp
|
||||
|
||||
ft_strcmp:
|
||||
mov rcx, 0
|
||||
loop:
|
||||
mov dl, [rsi + rcx]
|
||||
mov bl, [rdi + rcx]
|
||||
|
||||
cmp bl, 0
|
||||
je out
|
||||
|
||||
cmp bl, dl
|
||||
jne out
|
||||
|
||||
inc rcx
|
||||
jmp loop
|
||||
out:
|
||||
mov rax, 0
|
||||
mov rbx, 0
|
||||
mov bl, BYTE [rsi + rcx]
|
||||
mov al, BYTE [rdi + rcx]
|
||||
sub rax, rbx
|
||||
ret
|
Loading…
Reference in New Issue
Block a user