Browse Source

corrected

ceriel 34 years ago
parent
commit
0710269e32
4 changed files with 6 additions and 70 deletions
  1. 2 9
      mach/i86/libsys/_brk.s
  2. 2 3
      mach/i86/libsys/_sbrk.s
  3. 1 36
      mach/i86/libsys/brk.s
  4. 1 22
      mach/i86/libsys/sbrk.s

+ 2 - 9
mach/i86/libsys/_brk.s

@@ -1,18 +1,14 @@
 .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
 .define __brk
 .define xbrk
-.define np
-.extern __brk
-.extern xbrk,endbss
-.extern np, cerror
 __brk:	
 	mov bx,sp
 	mov ax,2(bx)
 	mov cx,sp
 	sub cx,128
 	jbe 1f
-	mov bx,(np)
-	mov (np),ax
+	mov bx,(.limhp)
+	mov (.limhp),ax
 	sub ax,bx
 	jbe 2f
 	call xbrk
@@ -34,6 +30,3 @@ xbrk:
 3:
 	pop di
 	ret
-.sect .data
-np: .data2 endbss
-.sect .text

+ 2 - 3
mach/i86/libsys/_sbrk.s

@@ -1,17 +1,16 @@
 .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
 .define __sbrk
-.extern __sbrk, xbrk, cerror
 __sbrk:
 push	bp
 mov	bp,sp
 mov	ax,4(bp)
-mov	bx,(np)
+mov	bx,(.limhp)
 add	ax,bx
 mov	cx,sp
 sub	cx,128
 sub	cx,ax
 jbe	1f
-mov	(np),ax
+mov	(.limhp),ax
 sub	ax,bx
 jbe	2f
 call	xbrk

+ 1 - 36
mach/i86/libsys/brk.s

@@ -1,39 +1,4 @@
 .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
 .define _brk
-.define xbrk
-.define np
-.extern _brk
-.extern xbrk,endbss
-.extern np, cerror
 _brk:	
-	mov bx,sp
-	mov ax,2(bx)
-	mov cx,sp
-	sub cx,128
-	jbe 1f
-	mov bx,(np)
-	mov (np),ax
-	sub ax,bx
-	jbe 2f
-	call xbrk
-2:
-	xor ax,ax
-	ret
-1:
-	mov ax,0xc
-	jmp cerror
-xbrk:
-	push di
-	mov di,bx
-	mov cx,ax
-	xor ax,ax
-	shr cx,1
-	repz stos
-	jae 3f
-	stosb
-3:
-	pop di
-	ret
-.sect .data
-np: .data2 endbss
-.sect .text
+	jmp __brk

+ 1 - 22
mach/i86/libsys/sbrk.s

@@ -1,25 +1,4 @@
 .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
 .define _sbrk
-.extern _sbrk, xbrk, cerror
 _sbrk:
-push	bp
-mov	bp,sp
-mov	ax,4(bp)
-mov	bx,(np)
-add	ax,bx
-mov	cx,sp
-sub	cx,128
-sub	cx,ax
-jbe	1f
-mov	(np),ax
-sub	ax,bx
-jbe	2f
-call	xbrk
-2:
-mov	ax,bx
-pop	bp
-ret
-1:
-mov	ax,0xc
-pop	bp
-jmp	cerror
+	jmp __sbrk