xref: /csrg-svn/lib/libc/vax/sys/sbrk.s (revision 21864)
1/*
2 * Copyright (c) 1983 Regents of the University of California.
3 * All rights reserved.  The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
7#ifndef lint
8static char sccsid[] = "@(#)sbrk.s	5.1 (Berkeley) 06/03/85";
9#endif not lint
10
11#include "SYS.h"
12
13#define	SYS_brk		17
14
15	.globl	_end
16	.globl	minbrk
17	.globl	curbrk
18
19	.data
20minbrk: .long	_end
21curbrk:	.long	_end
22	.text
23
24ENTRY(sbrk)
25	addl3	curbrk,4(ap),-(sp)
26	pushl	$1
27	movl	ap,r3
28	movl	sp,ap
29	chmk	$SYS_brk
30	jcs 	err
31	movl	curbrk,r0
32	addl2	4(r3),curbrk
33	ret
34err:
35	jmp	cerror
36