xref: /original-bsd/lib/libc/hp300/sys/sbrk.s (revision c3e32dec)
1/*-
2 * Copyright (c) 1990, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * the Systems Programming Group of the University of Utah Computer
7 * Science Department.
8 *
9 * %sccs.include.redist.c%
10 */
11
12#if defined(LIBC_SCCS) && !defined(lint)
13	.asciz "@(#)sbrk.s	8.1 (Berkeley) 06/07/93"
14#endif /* LIBC_SCCS and not lint */
15
16#include "SYS.h"
17
18#define	SYS_brk		17
19
20	.globl	_end
21	.globl	minbrk
22	.globl	curbrk
23
24	.data
25minbrk: .long	_end
26curbrk:	.long	_end
27	.text
28
29ENTRY(sbrk)
30	movl	curbrk,d0
31	addl	d0,sp@(4)
32	movl	#SYS_brk,d0
33	trap	#0
34	jcs 	err
35	movl	curbrk,d0
36	movl	sp@(4),curbrk
37	rts
38err:
39	jmp	cerror
40