Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .global mystrcmp
- mystrcmp:
- pushl %ebp
- movl %esp, %ebp
- pushl %esi
- movl 8(%ebp), %eax
- movl 12(%ebp), %edx
- loop:
- movzbl (%edx), %ecx
- movzbl (%eax), %esi
- cmpl %ecx, %esi
- jnz not_eq
- cmpl $0, %esi
- jnz change_id
- cmpl $0, %ecx
- jz eq
- change_id:
- incl %eax
- incl %edx
- jmp loop
- not_eq:
- subl %ecx, %esi
- movl %esi, %eax
- popl %esi
- movl %ebp, %esp
- popl %ebp
- ret
- eq:
- popl %esi
- movl %ebp, %esp
- popl %ebp
- xorl %eax, %eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement