xref: /csrg-svn/lib/libc/vax/gen/alloca.s (revision 47908)
1*47908Sbostic/*-
2*47908Sbostic * Copyright (c) 1983 The Regents of the University of California.
3*47908Sbostic * All rights reserved.
4*47908Sbostic *
5*47908Sbostic * %sccs.include.proprietary.c%
621419Sdist */
721419Sdist
8*47908Sbostic#if defined(LIBC_SCCS) && !defined(lint)
9*47908Sbostic	.asciz "@(#)alloca.s	5.4 (Berkeley) 04/12/91"
10*47908Sbostic#endif /* LIBC_SCCS and not lint */
1121419Sdist
1217328Ssam/* like alloc, but automatic free in return */
1313422Sroot
1413422Sroot#include "DEFS.h"
1513422Sroot
1617328SsamENTRY(alloca, 0)
1713422Sroot	subl2	4(ap),sp	/* crude allocation */
1813422Sroot	movl	16(fp),r1	/* pc */
1913422Sroot	movq	8(fp),ap	/* new (old) ap and fp */
2013422Sroot	bicl2	$3,sp		/* 4-byte align */
2113422Sroot	addl2	$7*4,sp		/* reuse space of mscp */
2213422Sroot	movl	sp,r0		/* return value */
2313422Sroot	jmp 	(r1)		/* funny return */
24