projects
/
bootcensus
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fixed clear .bss code
[bootcensus]
/
src
/
regs.s
1
.text
2
.align 4
3
4
.globl get_regs
5
get_regs:
6
pushl %ebp
7
movl %esp, %ebp
8
9
pushl %edx
10
movl 8(%ebp), %edx
11
12
movl %eax, (%edx)
13
movl %ebx, 4(%edx)
14
movl %ecx, 8(%edx)
15
16
# juggle edx
17
movl %edx, %eax
18
popl %edx
19
movl %edx, 12(%eax)
20
pushl %edx
21
movl %eax, %edx
22
23
# those two are pointless in a function
24
movl %esp, 16(%edx)
25
movl %ebp, 20(%edx)
26
27
movl %esi, 24(%edx)
28
movl %edi, 28(%edx)
29
30
pushf
31
popl %eax
32
movl %eax, 32(%edx)
33
34
movw %cs, 36(%edx)
35
movw %ss, 40(%edx)
36
movw %ds, 44(%edx)
37
movw %es, 48(%edx)
38
movw %fs, 52(%edx)
39
movw %gs, 56(%edx)
40
41
pushl %ebx
42
movl %cr0, %ebx
43
movl %ebx, 60(%edx)
44
#movl %cr1, %ebx
45
#movl %ebx, 64(%edx)
46
movl %cr2, %ebx
47
movl %ebx, 68(%edx)
48
movl %cr3, %ebx
49
movl %ebx, 72(%edx)
50
popl %ebx
51
52
popl %edx
53
popl %ebp
54
ret