corrected

This commit is contained in:
ceriel 1990-01-22 16:48:13 +00:00
parent b2cbaa46d5
commit 0710269e32
4 changed files with 6 additions and 70 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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