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.asm
1
;
2
; Acess2 C Library
3
; - By John Hodge (thePowersGang)
4
;
5
; arch/x86.asm
6
; - x86 specific code
7
[bits 32]
8
[section .text]
9
10
[global setjmp:function]
11
setjmp:
12
mov eax, [esp+4] ; Get base of buffer
13
14
mov [eax+0x00], eax
15
mov [eax+0x04], ecx
16
mov [eax+0x08], edx
17
mov [eax+0x0C], ebx
18
mov [eax+0x10], esi
19
mov [eax+0x14], edi
20
mov [eax+0x18], esp
21
mov [eax+0x1C], ebp
22
23
xor eax, eax
24
ret
25
setjmp.restore:
26
ret
27
28
[global longjmp:function]
29
longjmp:
30
mov ebp, [esp+4] ; jmp_buf
31
mov eax, [esp+8] ; value
32
33
;mov eax, [ebp+0x00]
34
mov ecx, [ebp+0x04]
35
mov edx, [ebp+0x08]
36
mov ebx, [ebp+0x0C]
37
mov esi, [ebp+0x10]
38
mov edi, [ebp+0x14]
39
mov esp, [ebp+0x18]
40
mov ebp, [ebp+0x1C]
41
42
test eax, eax
43
jnz .ret
44
inc eax
45
46
; Return to where setjmp was called
47
.ret:
48
ret
49
UCC
git Repository :: git.ucc.asn.au