Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .global mul64p
- mul64p:
- push %ebp
- mov %esp, %ebp
- push %edi
- push %esi
- push %ebx
- //fourth part
- movl $0, %ebx
- movl 8(%ebp), %esi
- movl 16(%ebp), %eax
- movl $0, %edx
- mull %esi
- movl %eax, a
- //third part
- movl $0, %edi
- movl 8(%ebp), %esi
- movl 16(%ebp), %eax
- movl $0, %edx
- mull %esi
- addl %edx, %edi
- adc $0, %ebx
- movl 12(%ebp), %esi
- movl 16(%ebp), %eax
- movl $0, %edx
- mull %esi
- add %eax, %edi
- adc $0, %ebx
- movl 8(%ebp), %esi
- movl 20(%ebp), %eax
- movl $0, %edx
- mull %esi
- addl %eax, %edi
- adc $0, %ebx
- movl %edi, b
- //second part
- movl $0, %edi
- movl 12(%ebp), %esi
- movl 20(%ebp), %eax
- movl $0, %edx
- mull %esi
- movl $0, %ecx
- addl %eax, %edi
- addl %ebx, %edi
- adc $0, %ecx
- movl $0, %ebx
- movl %ecx, %ebx
- movl 12(%ebp), %esi
- movl 16(%ebp), %eax
- movl $0, %edx
- mull %esi
- add %edx, %edi
- adc $0, %ebx
- movl 8(%ebp), %esi
- movl 20(%ebp), %eax
- movl $0, %edx
- mull %esi
- addl %edx, %edi
- adc $0, %ebx
- movl %edi, c
- //fist part
- movl 12(%ebp), %esi
- movl 20(%ebp), %eax
- movl $0, %edx
- mull %esi
- addl %ebx, %edx
- movl %edx, d
- //writeResults
- movl $0, %ebx
- movl d, %eax
- testl %eax, %eax
- jz NWF
- movl $1, %ebx
- push %eax
- push $L
- call printf
- NWF:
- movl c, %eax
- testl %ebx, %ebx
- jnz WFS
- testl %eax, %eax
- jnz WS
- jmp NWS
- WFS:
- push %eax
- push $8
- push $FL
- call printf
- jmp NWS
- WS:
- push %eax
- push $L
- call printf
- NWS:
- movl b, %eax
- testl %ebx, %ebx
- jnz WFT
- testl %eax, %eax
- jnz WT
- jmp NWT
- WFT:
- push %eax
- push $8
- push $FL
- call printf
- jmp NWT
- WT:
- push %eax
- push $L
- call printf
- NWT:
- movl a, %eax
- testl %ebx, %ebx
- jnz WF
- push %eax
- push $NL
- call printf
- jmp END
- WF:
- push %eax
- push $8
- push $NFL
- call printf
- jmp END
- END:
- movl %ebp, %esp
- movl -12(%ebp), %ebx
- movl -8(%ebp), %esi
- movl -4(%ebp), %edi
- pop %ebp
- ret
- L: .asciz "%x"
- FL: .asciz "%0*x"
- NL: .asciz "%x\n"
- NFL: .asciz "%0*x\n"
- .data
- a: .int 0
- b: .int 0
- c: .int 0
- d: .int 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement