summaryrefslogtreecommitdiffhomepage
path: root/src/setjmp/nt64/setjmp.s
blob: a3988bbe817f1d5c591ecdf47e41dcb78e80a7a4 (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:
	pop  (%rcx)		# return address
	mov  %rsp, 0x08(%rcx)	# caller's stack pointer
	push (%rcx)		# restore own stack pointer

	mov  %rbx, 0x10(%rcx)
	mov  %rbp, 0x18(%rcx)
	mov  %rdi, 0x20(%rcx)
	mov  %rsi, 0x28(%rcx)
	mov  %r12, 0x30(%rcx)
	mov  %r13, 0x38(%rcx)
	mov  %r14, 0x40(%rcx)
	mov  %r15, 0x48(%rcx)

	xor %eax,  %eax
	ret

	.section .got$setjmp,"r"
	.global __imp_setjmp
__imp_setjmp:
	.quad	setjmp
	.linkonce discard