macos: ldd does not exit, use otool instead
[tinycc.git] / lib / alloca86.S
blobbdc739110d69323db99c835c566db20e0cfee38a
1 /* ---------------------------------------------- */
2 /* alloca86.S */
4 #ifdef __leading_underscore
5 # define _(s) _##s
6 #else
7 # define _(s) s
8 #endif
10 .globl _(alloca)
11 _(alloca):
12     pop     %edx
13     pop     %eax
14     add     $3,%eax
15     and     $-4,%eax
16     jz      p3
18 #ifdef _WIN32
19 p1:
20     cmp     $4096,%eax
21     jbe     p2
22     test    %eax,-4096(%esp)
23     sub     $4096,%esp
24     sub     $4096,%eax
25     jmp p1
26 p2:
27 #endif
29     sub     %eax,%esp
30     mov     %esp,%eax
31 p3:
32     push    %edx
33     push    %edx
34     ret
36 /* ---------------------------------------------- */