1987-01-08 10:41:08 +00:00
|
|
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
|
|
|
.define _brk
|
|
|
|
.define xbrk
|
|
|
|
.define np
|
|
|
|
.extern _brk
|
1987-02-18 16:41:57 +00:00
|
|
|
.extern xbrk,endbss
|
1987-01-08 10:41:08 +00:00
|
|
|
.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
|
1987-02-18 16:41:57 +00:00
|
|
|
np: .data2 endbss
|
1987-01-08 10:41:08 +00:00
|
|
|
.sect .text
|