setjmp.S 863 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
  3. * This program and the accompanying materials are licensed and made
  4. available
  5. * under the terms and conditions of the BSD License which accompanies
  6. this
  7. * distribution. The full text of the license may be found at
  8. * http://opensource.org/licenses/bsd-license.php.
  9. *
  10. * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
  11. BASIS,
  12. * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
  13. * IMPLIED.
  14. */
  15. .text
  16. .globl setjmp
  17. .type setjmp, @function
  18. setjmp:
  19. pop %ecx
  20. movl (%esp), %edx
  21. movl %ebx, (%edx)
  22. movl %esi, 4(%edx)
  23. movl %edi, 8(%edx)
  24. movl %ebp, 12(%edx)
  25. movl %esp, 16(%edx)
  26. xorl %eax, %eax
  27. jmp *%ecx
  28. .globl longjmp
  29. .type longjmp, @function
  30. longjmp:
  31. pop %eax
  32. pop %edx
  33. pop %eax
  34. movl (%edx), %ebx
  35. movl 4(%edx), %esi
  36. movl 8(%edx), %edi