File:  [Research Unix] / researchv10no / libc / sys / sbrk.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#old = sbrk(increment);
#
#sbrk gets increment more core, and returns a pointer
#	to the beginning of the new core area
#
	.set	break,17
.globl	_sbrk
.globl _end
.globl  cerror

	.align	1
_sbrk:
	.word	0x0000
	addl2	$3,4(ap)
	bicl2	$3,4(ap)
	addl3	nd,4(ap),-(sp)
	pushl	$1
	movl	ap,r3
	movl	sp,ap
	chmk	$break
	bcc 	noerr1
	jmp 	cerror
noerr1:
	movl	nd,r0
	addl2	4(r3),nd
	ret

.globl	_brk
# brk(value)
# as described in man2.
# returns 0 for ok, -1 for error.

_brk:
	.word	0x0000
	chmk	$break
	bcc 	noerr2
	jmp 	cerror
noerr2:
	movl	4(ap),nd
	clrl	r0
	ret

	.data
nd:	.long	_end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.