xref: /csrg-svn/lib/libc/vax/gen/alloca.s (revision 61225)
147908Sbostic/*-
2*61225Sbostic * Copyright (c) 1991, 1993
3*61225Sbostic *	The Regents of the University of California.  All rights reserved.
447908Sbostic *
548341Sbostic * %sccs.include.redist.c%
621419Sdist */
721419Sdist
847908Sbostic#if defined(LIBC_SCCS) && !defined(lint)
9*61225Sbostic	.asciz "@(#)alloca.s	8.1 (Berkeley) 06/04/93"
1047908Sbostic#endif /* LIBC_SCCS and not lint */
1121419Sdist
1213422Sroot#include "DEFS.h"
1313422Sroot
1417328SsamENTRY(alloca, 0)
1548341Sbostic	movl	4(ap),r0	# get allocation size
1648341Sbostic	movl	16(fp),r2	# save return address before we smash it
1748341Sbostic	movab	here,16(fp)
1848341Sbostic	ret
1948341Sbostichere:
2048341Sbostic	subl2	r0,sp		# create stack space
2148341Sbostic	bicl2	$3,sp		# align to longword boundary
2248341Sbostic	movl	sp,r0
2348341Sbostic	jmp	(r2)
24