Commit | Line | Data |
---|---|---|
4b9ccde7 | 1 | # @(#)alloca.s 4.1 (Berkeley) 12/21/80 |
9c8fc5ca BJ |
2 | # like alloc, but automatic |
3 | # automatic free in return | |
4 | ||
5 | .globl _alloca | |
6 | _alloca: | |
7 | .word 0x0000 | |
8 | subl2 4(ap),sp # crude allocation | |
9 | movl 16(fp),r1 # pc | |
10 | movq 8(fp),ap # new (old) ap and fp | |
11 | bicl2 $3,sp # 4-byte align | |
12 | addl2 $7*4,sp # reuse space of mscp | |
13 | movl sp,r0 # return value | |
14 | jmp (r1) # funny return |