Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- A: .asciz "helloworld123а567890"
- B: .asciz "helloworld123б567890"
- .text
- .global mystrcmp
- .global A
- .global B
- .global main
- mystrcmp:
- pushl %ebp
- movl %esp, %ebp
- pushl %ebx
- pushl %esi
- pushl %edi
- pushl %ecx
- movl 8(%ebp), %ebx
- movl 12(%ebp), %esi
- xorl %edi, %edi
- xorl %ecx, %ecx
- movzx (%esi), %edi
- movzx (%ebx), %ecx
- movl $1, %eax
- loop:
- cmpl $0, %ecx
- jz str1_end
- cmpl $0, %edi
- jz out
- cmpl %ecx, %edi
- jl out
- jnz neg
- addl $1, %ebx
- addl $1, %esi
- movzx (%esi), %edi
- movzx (%ebx), %ecx
- jmp loop
- str1_end:
- movl $0, %eax
- cmpl $0, %edi
- jz out
- neg:
- movl $-1, %eax
- out:
- popl %ecx
- popl %edi
- popl %esi
- popl %ebx
- popl %ebp
- ret
- main:
- pushl $B
- pushl $A
- call mystrcmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement