home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari FTP
/
ATARI_FTP_0693.zip
/
ATARI_FTP_0693
/
Mint
/
mntlib25.zoo
/
sozobon
/
alloca.s
next >
Wrap
Text File
|
1992-02-12
|
485b
|
23 lines
; alloca(nbytes) allocate junk in stack frame
;
; void *alloca(size_t size)
;
.text
.even
.globl _alloca
_alloca:
move.l (sp)+,a0 ; get return addr
move.w (sp)+,d0 ; get size -- assist in bug fix, add 2 to sp
addq.w #1,d0 ; ensure address even
bclr #0,d0
sub.w d0,sp ; increase stack frame size by that much
move.l sp,d0 ; set up to return it
subq.l #2,sp ; new top of stack (real bug fix here)
jmp (a0) ; return by jmping via saved addr