setjmp.S revision 1.1 1 1.1 jmcneill /* $NetBSD: setjmp.S,v 1.1 2018/08/16 18:17:47 jmcneill Exp $ */
2 1.1 jmcneill
3 1.1 jmcneill /*
4 1.1 jmcneill * Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 1.1 jmcneill * This program and the accompanying materials are licensed and made
6 1.1 jmcneill available
7 1.1 jmcneill * under the terms and conditions of the BSD License which accompanies
8 1.1 jmcneill this
9 1.1 jmcneill * distribution. The full text of the license may be found at
10 1.1 jmcneill * http://opensource.org/licenses/bsd-license.php.
11 1.1 jmcneill *
12 1.1 jmcneill * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
13 1.1 jmcneill BASIS,
14 1.1 jmcneill * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
15 1.1 jmcneill * IMPLIED.
16 1.1 jmcneill */
17 1.1 jmcneill .text
18 1.1 jmcneill .globl setjmp
19 1.1 jmcneill #ifndef __MINGW32__
20 1.1 jmcneill .type setjmp, @function
21 1.1 jmcneill #else
22 1.1 jmcneill .def setjmp; .scl 2; .type 32; .endef
23 1.1 jmcneill #endif
24 1.1 jmcneill setjmp:
25 1.1 jmcneill pop %ecx
26 1.1 jmcneill movl (%esp), %edx
27 1.1 jmcneill movl %ebx, (%edx)
28 1.1 jmcneill movl %esi, 4(%edx)
29 1.1 jmcneill movl %edi, 8(%edx)
30 1.1 jmcneill movl %ebp, 12(%edx)
31 1.1 jmcneill movl %esp, 16(%edx)
32 1.1 jmcneill xorl %eax, %eax
33 1.1 jmcneill jmp *%ecx
34 1.1 jmcneill
35 1.1 jmcneill .globl longjmp
36 1.1 jmcneill #ifndef __MINGW32__
37 1.1 jmcneill .type longjmp, @function
38 1.1 jmcneill #else
39 1.1 jmcneill .def longjmp; .scl 2; .type 32; .endef
40 1.1 jmcneill #endif
41 1.1 jmcneill longjmp:
42 1.1 jmcneill pop %eax
43 1.1 jmcneill pop %edx
44 1.1 jmcneill pop %eax
45 1.1 jmcneill movl (%edx), %ebx
46 1.1 jmcneill movl 4(%edx), %esi
47 1.1 jmcneill movl 8(%edx), %edi
48