xref: /csrg-svn/lib/libc/vax/gen/alloca.s (revision 48341)
147908Sbostic/*-
2*48341Sbostic * Copyright (c) 1991 The Regents of the University of California.
347908Sbostic * All rights reserved.
447908Sbostic *
5*48341Sbostic * %sccs.include.redist.c%
621419Sdist */
721419Sdist
847908Sbostic#if defined(LIBC_SCCS) && !defined(lint)
9*48341Sbostic	.asciz "@(#)alloca.s	5.5 (Berkeley) 04/18/91"
1047908Sbostic#endif /* LIBC_SCCS and not lint */
1121419Sdist
1213422Sroot#include "DEFS.h"
1313422Sroot
1417328SsamENTRY(alloca, 0)
15*48341Sbostic	movl	4(ap),r0	# get allocation size
16*48341Sbostic	movl	16(fp),r2	# save return address before we smash it
17*48341Sbostic	movab	here,16(fp)
18*48341Sbostic	ret
19*48341Sbostichere:
20*48341Sbostic	subl2	r0,sp		# create stack space
21*48341Sbostic	bicl2	$3,sp		# align to longword boundary
22*48341Sbostic	movl	sp,r0
23*48341Sbostic	jmp	(r2)
24