Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .global mystrcmp
- mystrcmp:
- pushl %ebp
- movl %esp, %ebp
- pushl %edi
- pushl %esi
- pushl %ebx
- pushl %ecx
- movl 8(%ebp), %edi
- movl 12(%ebp), %esi
- movzbl (%edi), %ebx
- movzbl (%esi), %ecx
- cmpl %ebx, %ecx
- je equal
- jg greater
- jl less
- equal:
- movl $0, %eax
- cmpl %ebx, %eax
- je ending
- incl %edi
- incl %esi
- movzbl (%edi), %ebx
- movzbl (%esi), %ecx
- cmpl %ebx, %ecx
- je equal
- jg greater
- jl less
- greater:
- movl $1, %eax
- jmp ending
- less:
- movl $-1, %eax
- jmp ending
- ending:
- popl %ecx
- popl %ebx
- popl %esi
- popl %edi
- movl %esp, %ebp
- popl %ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement