add: strcmp
This commit is contained in:
		| @ -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 | ||||||
		Reference in New Issue
	
	Block a user