summaryrefslogtreecommitdiffhomepage
path: root/src/setjmp/nt32/setjmp.s
blob: d00fba0f0a3d094a32d68d469cfc02b2d4c7d7ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.text
.globl	___setjmp
.globl	__setjmp
.globl	_setjmp

.def ___setjmp; .scl 2; .type 32; .endef
.def __setjmp; .scl 2; .type 32; .endef
.def _setjmp; .scl 2; .type 32; .endef

___setjmp:
__setjmp:
_setjmp:
	movl 4(%esp), %edx	# jump buffer

	movl (%esp),  %eax	# return address
	movl %eax,    (%edx)

	leal 4(%esp), %ecx	# caller's stack pointer
	movl %ecx,    4(%edx)

	movl %ebx,    8(%edx)
	movl %ebp,    12(%edx)
	movl %edi,    16(%edx)
	movl %esi,    20(%edx)

	xor  %eax,%eax
	ret

	.section .got$setjmp,"r"
	.global __imp__setjmp
__imp__setjmp:
	.long	_setjmp
	.linkonce discard