Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- one: .int 1
- print: .asciz "%llx"
- zprint: .asciz "%016llx"
- nl: .asciz "\n"
- .text
- .global mul64p
- mul64p:
- push %ebp
- push %edi
- push %esi
- push %ebx
- movl %esp, %ebp
- subl $16, %esp
- movl 20(%ebp), %eax
- mull 28(%ebp)
- movl %eax, -16(%ebp)
- movl %edx, -12(%ebp)
- movl 24(%ebp), %eax
- mull 32(%ebp)
- movl %eax, -8(%ebp)
- movl %edx, -4(%ebp)
- movl 20(%ebp), %eax
- mull 32(%ebp)
- addl %eax, -12(%ebp)
- adcl %edx, -8(%ebp)
- adcl $0, -4(%ebp)
- movl 24(%ebp), %eax
- mull 28(%ebp)
- addl %eax, -12(%ebp)
- adcl %edx, -8(%ebp)
- adcl $0, -4(%ebp)
- xorl %edi, %edi
- xorl %esi, %esi
- cmpl $0, 12(%esp)
- cmove one, %edi
- cmpl $0, 8(%esp)
- cmove one, %esi
- addl %esi, %edi
- movl $print, %ebx
- movl $zprint, %eax
- cmpl $2, %edi
- cmovne %eax, %ebx
- cmpl $2, %edi
- je L1
- pushl 12(%esp)
- pushl 12(%esp)
- push $print
- call printf
- addl $12, %esp
- L1: push %ebx
- call printf
- push $nl
- call printf
- xorl %eax, %eax
- addl $24, %esp
- popl %ebx
- popl %esi
- popl %edi
- popl %ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement