summaryrefslogtreecommitdiffhomepage
path: root/src/setjmp/nt32/longjmp.s
blob: 045b93d927e376aef520e6e90e050320fb92186e (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
34
35
.text
.globl	___longjmp
.globl	__longjmp
.globl	_longjmp

.def ___longjmp; .scl 2; .type 32; .endef
.def __longjmp; .scl 2; .type 32; .endef
.def _longjmp; .scl 2; .type 32; .endef

___longjmp:
__longjmp:
_longjmp:
	movl 4(%esp), %ecx	# jump buffer
	movl 8(%esp), %eax	# val

	test %eax, %eax		# is val zero?
	jne  1f			# no:  return val
	xor  $1,   %eax		# yes: return one

1:
	movl 20(%ecx), %esi	# restore regs
	movl 16(%ecx), %edi
	movl 12(%ecx), %ebp
	movl 8(%ecx),  %ebx

	movl 4(%ecx),  %esp	# original stack pointer

	movl (%ecx),   %edx	# original return address
	jmp  *%edx

	.section .got$longjmp
	.global __imp__longjmp
__imp__longjmp:
	.long	_longjmp
	.linkonce discard