corrected
This commit is contained in:
parent
b2cbaa46d5
commit
0710269e32
4 changed files with 6 additions and 70 deletions
|
@ -1,18 +1,14 @@
|
||||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.define __brk
|
.define __brk
|
||||||
.define xbrk
|
.define xbrk
|
||||||
.define np
|
|
||||||
.extern __brk
|
|
||||||
.extern xbrk,endbss
|
|
||||||
.extern np, cerror
|
|
||||||
__brk:
|
__brk:
|
||||||
mov bx,sp
|
mov bx,sp
|
||||||
mov ax,2(bx)
|
mov ax,2(bx)
|
||||||
mov cx,sp
|
mov cx,sp
|
||||||
sub cx,128
|
sub cx,128
|
||||||
jbe 1f
|
jbe 1f
|
||||||
mov bx,(np)
|
mov bx,(.limhp)
|
||||||
mov (np),ax
|
mov (.limhp),ax
|
||||||
sub ax,bx
|
sub ax,bx
|
||||||
jbe 2f
|
jbe 2f
|
||||||
call xbrk
|
call xbrk
|
||||||
|
@ -34,6 +30,3 @@ xbrk:
|
||||||
3:
|
3:
|
||||||
pop di
|
pop di
|
||||||
ret
|
ret
|
||||||
.sect .data
|
|
||||||
np: .data2 endbss
|
|
||||||
.sect .text
|
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.define __sbrk
|
.define __sbrk
|
||||||
.extern __sbrk, xbrk, cerror
|
|
||||||
__sbrk:
|
__sbrk:
|
||||||
push bp
|
push bp
|
||||||
mov bp,sp
|
mov bp,sp
|
||||||
mov ax,4(bp)
|
mov ax,4(bp)
|
||||||
mov bx,(np)
|
mov bx,(.limhp)
|
||||||
add ax,bx
|
add ax,bx
|
||||||
mov cx,sp
|
mov cx,sp
|
||||||
sub cx,128
|
sub cx,128
|
||||||
sub cx,ax
|
sub cx,ax
|
||||||
jbe 1f
|
jbe 1f
|
||||||
mov (np),ax
|
mov (.limhp),ax
|
||||||
sub ax,bx
|
sub ax,bx
|
||||||
jbe 2f
|
jbe 2f
|
||||||
call xbrk
|
call xbrk
|
||||||
|
|
|
@ -1,39 +1,4 @@
|
||||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.define _brk
|
.define _brk
|
||||||
.define xbrk
|
|
||||||
.define np
|
|
||||||
.extern _brk
|
|
||||||
.extern xbrk,endbss
|
|
||||||
.extern np, cerror
|
|
||||||
_brk:
|
_brk:
|
||||||
mov bx,sp
|
jmp __brk
|
||||||
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
|
|
||||||
|
|
|
@ -1,25 +1,4 @@
|
||||||
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
.define _sbrk
|
.define _sbrk
|
||||||
.extern _sbrk, xbrk, cerror
|
|
||||||
_sbrk:
|
_sbrk:
|
||||||
push bp
|
jmp __sbrk
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in a new issue