2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / i386 / uwin.asm
blob8566be18a1dba139b72ad0e7d0645055bc9fd86e
1 /* stuff needed for libgcc on win32. */
3 #ifdef L_chkstk
5 .global __chkstk
6 .global __alloca
7 __chkstk:
8 __alloca:
9 pushl %ecx /* save temp */
10 movl %esp,%ecx /* get sp */
11 addl $0x8,%ecx /* and point to return addr */
13 probe: cmpl $0x1000,%eax /* > 4k ?*/
14 jb done
16 subl $0x1000,%ecx /* yes, move pointer down 4k*/
17 orl $0x0,(%ecx) /* probe there */
18 subl $0x1000,%eax /* decrement count */
19 jmp probe /* and do it again */
21 done: subl %eax,%ecx
22 orl $0x0,(%ecx) /* less that 4k, just peek here */
24 movl %esp,%eax
25 movl %ecx,%esp /* decrement stack */
27 movl (%eax),%ecx /* recover saved temp */
28 movl 4(%eax),%eax /* get return address */
29 jmp *%eax
32 #endif