Move _heap.h to the compiler include dir.

Create heap.inc and use that from the assembler code.
Rename heap related _h... variables to _heap...
Add _heapmaxavail and _heapmemavail functions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1912 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-02-01 12:22:09 +00:00
parent 8012074ea0
commit 581c12ce40
11 changed files with 422 additions and 246 deletions

View File

@@ -4,23 +4,25 @@
; Heap variables and initialization.
;
.export __horg, __hptr, __hend, __hfirst, __hlast
.constructor initheap, 24
.import __BSS_RUN__, __BSS_SIZE__, __STACKSIZE__
.importzp sp
.include "_heap.inc"
.data
__horg:
__heaporg:
.word __BSS_RUN__+__BSS_SIZE__ ; Linker calculates this symbol
__hptr:
.word __BSS_RUN__+__BSS_SIZE__ ; Dito
__hend:
__heapptr:
.word __BSS_RUN__+__BSS_SIZE__ ; Dito
__heapend:
.word __BSS_RUN__+__BSS_SIZE__
__hfirst:
.word 0
__hlast:
.word 0
__heapfirst:
.word 0
__heaplast:
.word 0
; Initialization. Will be called from startup!
@@ -28,12 +30,12 @@ __hlast:
.code
initheap:
sec
lda sp
sbc #<__STACKSIZE__
sta __hend
lda sp+1
sec
lda sp
sbc #<__STACKSIZE__
sta __heapend
lda sp+1
sbc #>__STACKSIZE__
sta __hend+1
sta __heapend+1
rts