removed some verbose messages
[minix3.git] / lib / i86 / misc / alloca.s
blob560f096d1883bc9ca2493d7126fe7b8ddd7fe7fe
2 ! alloca() - allocate space on the stack Author: Kees J. Bot
3 ! 26 Jan 1994
5 #if __ACK__ /* BCC can't do alloca(), register saving is wrong. */
7 .text
8 .define _alloca
9 _alloca:
10 pop cx ! Return address
11 pop ax ! Bytes to allocate
12 add ax, #2*2+1 ! Add space for two saved register variables
13 andb al, #0xFE ! Align
14 mov bx, sp ! Keep current sp
15 sub sp, ax ! Lower stack
16 mov ax, sp ! Return value
17 push 2(bx) ! Push what is probably the saved si
18 push (bx) ! Saved di
19 ! Now ACK can still do:
20 ! pop di; pop si; mov sp, bp; pop bp; ret
21 push ax ! Dummy argument
22 jmp (cx)
23 #endif