Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- one:
- .double 1
- sign:
- .double -1
- .text
- .global mysin
- mysin:
- pushl %ebp
- movl %esp, %ebp
- pushl %ebx
- pushl %esi
- pushl %edi
- movsd %xmm7, %xmm0 // xmm0 = sum
- movsd %xmm7, %xmm1 // xmm1 = last
- movsd one, %xmm2 // xmm2 = 1,3,5
- movsd sign, %xmm3 // xmm3 = sign
- movsd one, %xmm5 //xmm5 = const = 1
- cycle:
- movsd %xmm0, %xmm4
- mulsd %xmm3, %xmm1
- mulsd %xmm7, %xmm1
- mulsd %xmm7, %xmm1
- addsd %xmm5, %xmm2
- divsd %xmm2, %xmm1
- addsd %xmm5, %xmm2
- divsd %xmm2, %xmm1
- addsd %xmm1, %xmm0
- comisd %xmm0, %xmm4
- je end
- jmp cycle
- end:
- movsd %xmm0, %xmm7
- movl -12(%ebp), %edi
- movl -8(%ebp), %esi
- movl -4(%ebp), %ebx
- movl %ebp, %esp
- popl %ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement