Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. .text
  2. .align 8
  3. .globl asm_yield
  4. asm_yield:
  5. pushq %rbp
  6. movq %rsp,%rbp
  7. cmpq $0,%rdi
  8. je thread_restore
  9.  
  10.  
  11. thread_save:
  12. movq %rsp,0(%rdi)
  13. movq %rbx,8(%rdi)
  14. movq %rdi,16(%rdi)
  15. movq %rsi,24(%rdi)
  16. movq %r12,32(%rdi)
  17. movq %r13,40(%rdi)
  18. movq %r14,48(%rdi)
  19. movq %r15,56(%rdi)
  20.  
  21. thread_restore:
  22. movq 0(%rsi),%rsp
  23. movq 8(%rsi),%rbx
  24. movq 16(%rsi),%rdi
  25. movq 32(%rsi),%r12
  26. movq 40(%rsi),%r13
  27. movq 48(%rsi),%r14
  28. movq 56(%rsi),%r15
  29. movq 24(%rsi),%rsi
  30. popq %rbp
  31. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement