blob: 3e8a1ea65e370e93b039bd99303e2c1e6cd32422 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
.text
.globl __setjmp
.globl _setjmp
.globl setjmp
__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
|