xref: /csrg-svn/lib/libc/vax/gen/alloca.s (revision 21419)
1*21419Sdist/*
2*21419Sdist * Copyright (c) 1980 Regents of the University of California.
3*21419Sdist * All rights reserved.  The Berkeley software License Agreement
4*21419Sdist * specifies the terms and conditions for redistribution.
5*21419Sdist */
6*21419Sdist
7*21419Sdist#ifndef lint
8*21419Sdiststatic char sccsid[] = "@(#)alloca.s	5.1 (Berkeley) 05/30/85";
9*21419Sdist#endif not lint
10*21419Sdist
1117328Ssam/* like alloc, but automatic free in return */
1213422Sroot
1313422Sroot#include "DEFS.h"
1413422Sroot
1517328SsamENTRY(alloca, 0)
1613422Sroot	subl2	4(ap),sp	/* crude allocation */
1713422Sroot	movl	16(fp),r1	/* pc */
1813422Sroot	movq	8(fp),ap	/* new (old) ap and fp */
1913422Sroot	bicl2	$3,sp		/* 4-byte align */
2013422Sroot	addl2	$7*4,sp		/* reuse space of mscp */
2113422Sroot	movl	sp,r0		/* return value */
2213422Sroot	jmp 	(r1)		/* funny return */
23