xref: /original-bsd/lib/libc/vax/gen/alloca.s (revision c3e32dec)
1/*-
2 * Copyright (c) 1991, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 */
7
8#if defined(LIBC_SCCS) && !defined(lint)
9	.asciz "@(#)alloca.s	8.1 (Berkeley) 06/04/93"
10#endif /* LIBC_SCCS and not lint */
11
12#include "DEFS.h"
13
14ENTRY(alloca, 0)
15	movl	4(ap),r0	# get allocation size
16	movl	16(fp),r2	# save return address before we smash it
17	movab	here,16(fp)
18	ret
19here:
20	subl2	r0,sp		# create stack space
21	bicl2	$3,sp		# align to longword boundary
22	movl	sp,r0
23	jmp	(r2)
24