diff options
| author | Uneven Prankster <unevenprankster@protonmail.com> | 2023-07-12 21:05:57 -0300 |
|---|---|---|
| committer | Uneven Prankster <unevenprankster@protonmail.com> | 2023-07-12 21:05:57 -0300 |
| commit | 111c133b939c15c57c90cd474d55e84928c6307a (patch) | |
| tree | 3e6ed21eaaf21a8f8f4c5c9933972ea476d37b8e /tinycc/win32/lib/chkstk.S | |
| parent | fa2bdd711212ba6b7a94a20971e8bfa281e73296 (diff) | |
Officially past the point of no return. C scripting works!
Diffstat (limited to 'tinycc/win32/lib/chkstk.S')
| -rw-r--r-- | tinycc/win32/lib/chkstk.S | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/tinycc/win32/lib/chkstk.S b/tinycc/win32/lib/chkstk.S deleted file mode 100644 index 6f583a5..0000000 --- a/tinycc/win32/lib/chkstk.S +++ /dev/null @@ -1,73 +0,0 @@ -/* ---------------------------------------------- */ -/* chkstk86.s */ - -#ifdef __leading_underscore -# define _(s) _##s -#else -# define _(s) s -#endif - -/* ---------------------------------------------- */ -#ifndef __x86_64__ -/* ---------------------------------------------- */ - -.globl _(__chkstk) -_(__chkstk): - xchg (%esp),%ebp /* store ebp, get ret.addr */ - push %ebp /* push ret.addr */ - lea 4(%esp),%ebp /* setup frame ptr */ - push %ecx /* save ecx */ - mov %ebp,%ecx -P0: - sub $4096,%ecx - test %eax,(%ecx) - sub $4096,%eax - cmp $4096,%eax - jge P0 - sub %eax,%ecx - test %eax,(%ecx) - - mov %esp,%eax - mov %ecx,%esp - mov (%eax),%ecx /* restore ecx */ - jmp *4(%eax) - -/* ---------------------------------------------- */ -#else -/* ---------------------------------------------- */ - -.globl _(__chkstk) -_(__chkstk): - xchg (%rsp),%rbp /* store ebp, get ret.addr */ - push %rbp /* push ret.addr */ - lea 8(%rsp),%rbp /* setup frame ptr */ - push %rcx /* save ecx */ - mov %rbp,%rcx - movslq %eax,%rax -P0: - sub $4096,%rcx - test %rax,(%rcx) - sub $4096,%rax - cmp $4096,%rax - jge P0 - sub %rax,%rcx - test %rax,(%rcx) - - mov %rsp,%rax - mov %rcx,%rsp - mov (%rax),%rcx /* restore ecx */ - jmp *8(%rax) - -/* ---------------------------------------------- */ -/* setjmp/longjmp support */ - -.globl _(tinyc_getbp) -_(tinyc_getbp): - mov %rbp,%rax - ret - -/* ---------------------------------------------- */ -#endif -/* ---------------------------------------------- */ - - |
