setjmp64.S 467 B

123456789101112131415161718192021222324252627
  1. .globl setjmp
  2. setjmp:
  3. mov (%rsp), %rsi
  4. mov %rsi, (%rdi)
  5. mov %rsp, 0x8(%rdi)
  6. mov %rbp, 0x10(%rdi)
  7. mov %rbx, 0x18(%rdi)
  8. mov %r12, 0x20(%rdi)
  9. mov %r13, 0x28(%rdi)
  10. mov %r14, 0x30(%rdi)
  11. mov %r15, 0x38(%rdi)
  12. xor %eax, %eax
  13. ret
  14. .globl longjmp
  15. longjmp:
  16. mov %esi, %eax
  17. mov 0x38(%rdi), %r15
  18. mov 0x30(%rdi), %r14
  19. mov 0x28(%rdi), %r13
  20. mov 0x20(%rdi), %r12
  21. mov 0x18(%rdi), %rbx
  22. mov 0x10(%rdi), %rbp
  23. mov 0x8(%rdi), %rsp
  24. mov (%rdi), %rsi
  25. mov %rsi, (%rsp)
  26. ret