Created
May 22, 2014 14:37
-
-
Save Mischa-Alff/f68dbc034854bbae4b45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strlen: | |
mov esi, eax | |
xor ecx, ecx | |
.loop: | |
mov edx, [esi+ecx] | |
cmp edx, 0 | |
je .end | |
inc ecx | |
jmp .loop | |
.end: | |
mov eax, ecx | |
ret | |
strcmp: | |
pop eax | |
pop ebx | |
push eax | |
call strlen | |
push eax | |
mov eax, ebx | |
call strlen | |
mov ecx, eax | |
pop edx | |
pop eax | |
cmp edx, ecx | |
jne .false | |
mov edi, eax | |
mov esi, ebx | |
.loop: | |
cmp [edi+ecx], [esi+ecx] | |
jne .false | |
loop .loop | |
mov eax, 1 | |
ret | |
.false: | |
mov eax, 0 | |
ret | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment