home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
ALLOCA.S
< prev
next >
Wrap
Text File
|
1993-08-03
|
496b
|
25 lines
#APP
#
# alloca(nbytes) allocate junk in stack frame
#
# void *alloca(size_t size)
#
.text
.even
.globl _alloca
_alloca:
movel sp@+,a0 | get return addr
movel sp@+,d0 | get size -- assist in bug fix, add 4 to sp
addql #1,d0 | ensure address even
andl #0xFFFFFFFE,d0 | lop off extra bits
subl d0,sp | increase stack frame size by that much
movel sp,d0 | set up to return it
lea sp@(-4),sp | new top of stack (real bug fix here)
jmp a0@ | return by jmping via saved addr