uwin.asm revision 302408
1/* stuff needed for libgcc on win32.  */
2
3#ifdef L_chkstk
4
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 */
12
13probe: 	cmpl   $0x1000,%eax	/* > 4k ?*/
14	jb    done		
15
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 */
20
21done: 	subl   %eax,%ecx	   
22	orl    $0x0,(%ecx)	/* less that 4k, just peek here */
23
24	movl   %esp,%eax
25	movl   %ecx,%esp	/* decrement stack */
26
27	movl   (%eax),%ecx	/* recover saved temp */
28	movl   4(%eax),%eax	/* get return address */
29	jmp    *%eax	
30
31
32#endif
33