repo.or.cz
/
tinycc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
enable making tcc using libtcc
[tinycc.git]
/
win32
/
lib
/
chkstk.S
blob
837d8af2b3d9f6a1c356d7e5ea919de84eaf879e
1
// =================================================
2
// chkstk.s
3
4
.text
5
.globl __chkstk
6
7
__chkstk:
8
xchg (%esp), %ebp // store ebp, get ret.addr
9
push %ebp // push ret.addr
10
lea 4(%esp), %ebp // setup frame ptr
11
push %ecx // save ecx
12
mov %ebp, %ecx
13
P0:
14
sub $4096,%ecx
15
test %eax,(%ecx)
16
sub $4096,%eax
17
cmp $4096,%eax
18
jge P0
19
20
sub %eax,%ecx
21
mov %esp,%eax
22
test %eax,(%ecx)
23
mov %ecx,%esp
24
25
mov (%eax),%ecx // restore ecx
26
mov 4(%eax),%eax
27
push %eax
28
ret
29