git.ucc.asn.au
/
tpg
/
acess2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge branch 'master' of git://github.com/thepowersgang/acess2
[tpg/acess2.git]
/
Usermode
/
Libraries
/
libc.so_src
/
arch
/
x86_64.asm
1
;
2
; Acess2 C Library
3
; - By John Hodge (thePowersGang)
4
;
5
; arch/x86_64.asm
6
; - x86_64 specific code
7
[bits 64]
8
[section .text]
9
10
[global setjmp]
11
setjmp:
12
;mov [rdi+0x00], rax
13
mov [rdi+0x08], rcx
14
mov [rdi+0x10], rdx
15
mov [rdi+0x18], rbx
16
mov [rdi+0x20], rsi
17
mov [rdi+0x28], rdi
18
mov [rdi+0x30], rsp
19
mov [rdi+0x38], rbp
20
mov [rdi+0x40], r8
21
mov [rdi+0x48], r9
22
mov [rdi+0x50], r10
23
mov [rdi+0x58], r11
24
mov [rdi+0x60], r12
25
mov [rdi+0x68], r13
26
mov [rdi+0x70], r14
27
mov [rdi+0x78], r15
28
29
xor eax, eax
30
ret
31
setjmp.restore:
32
ret
33
34
[global longjmp]
35
longjmp:
36
mov rax, rsi
37
38
;mov rax, [rdi+0x00]
39
mov rcx, [rdi+0x08]
40
mov rdx, [rdi+0x10]
41
mov rbx, [rdi+0x18]
42
mov rsi, [rdi+0x20]
43
mov rdi, [rdi+0x28]
44
mov rsp, [rdi+0x30]
45
mov rbp, [rdi+0x38]
46
mov r8, [rdi+0x40]
47
mov r9, [rdi+0x48]
48
mov r10, [rdi+0x50]
49
mov r11, [rdi+0x58]
50
mov r12, [rdi+0x60]
51
mov r13, [rdi+0x68]
52
mov r14, [rdi+0x70]
53
mov r15, [rdi+0x78]
54
55
test eax, eax
56
jnz .ret
57
inc eax
58
59
; Return to where setjmp was called
60
.ret:
61
ret
62
UCC
git Repository :: git.ucc.asn.au