2007-02-20 00:41:26 +00:00
|
|
|
! $Source$
|
|
|
|
! $State$
|
|
|
|
! $Revision$
|
|
|
|
|
1987-01-08 10:13:48 +00:00
|
|
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
|
|
|
.sect .text
|
1985-02-07 15:33:13 +00:00
|
|
|
.define .strhp
|
1988-04-11 11:37:54 +00:00
|
|
|
.extern .reghp, .limhp, EHEAP, .trp
|
1985-02-07 15:33:13 +00:00
|
|
|
|
2007-02-20 00:41:26 +00:00
|
|
|
! Updates the heap pointer:
|
|
|
|
!
|
|
|
|
! int .strhp(void* newpointer)
|
|
|
|
!
|
|
|
|
! .reghp is the current heap pointer;
|
|
|
|
! .limhp is the current top of memory.
|
|
|
|
!
|
|
|
|
! If the desired new heap pointer is above the top of memory, then BRK is
|
|
|
|
! called to extend the memory.
|
|
|
|
|
1985-02-07 15:33:13 +00:00
|
|
|
.strhp:
|
|
|
|
pop bx
|
|
|
|
pop ax
|
|
|
|
mov (.reghp),ax
|
|
|
|
cmp ax,(.limhp)
|
|
|
|
jb 1f
|
|
|
|
add ax,02000
|
|
|
|
and ax,~0777
|
1988-07-13 14:29:32 +00:00
|
|
|
push bx
|
1988-07-13 12:51:57 +00:00
|
|
|
push ax
|
1992-06-30 15:02:32 +00:00
|
|
|
call BRK
|
1988-07-13 14:29:32 +00:00
|
|
|
pop cx
|
|
|
|
pop bx
|
|
|
|
cmp ax,-1
|
|
|
|
je 2f
|
1985-02-07 15:33:13 +00:00
|
|
|
1:
|
1990-01-22 15:32:44 +00:00
|
|
|
mov (.limhp),cx
|
1985-02-07 15:33:13 +00:00
|
|
|
jmp bx
|
|
|
|
2:
|
|
|
|
mov ax,EHEAP
|
1988-07-13 14:29:32 +00:00
|
|
|
push bx
|
|
|
|
jmp .trp
|