Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. factorialTail:
  2. movq 8(%rsp), %r8
  3. movq $0, %r9
  4. xorl %eax, %eax
  5. cmpq %r9, %r8
  6. sete %al
  7. negq %rax
  8. movq %rax, %r8
  9. test %rax, %rax
  10. je if56
  11. popq %r8
  12. addq $8, %rsp
  13. movq %r8, %rax
  14. subq $8, %rsp
  15. ret
  16. if56:
  17. movq 8(%rsp), %r8
  18. movq $1, %r9
  19. subq %r9, %r8
  20. movq 8(%rsp), %r9
  21. movq 0(%rsp), %r10
  22. imulq %r10, %r9
  23. movq %r8, 0(%rsp)
  24. movq %r9, 8(%rsp)
  25. jmp factorialTail
  26.  
  27. factorial:
  28. movq 0(%rsp), %r8
  29. movq $1, %r9
  30. movq %r9, 0(%rsp)
  31. pushq %r8
  32. jmp factorialTail
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement