]> git.sur5r.net Git - cc65/blob - libsrc/common/_heap.s
Fixed comments.
[cc65] / libsrc / common / _heap.s
1 ;
2 ; Ullrich von Bassewitz, 03.06.1998
3 ;
4 ; Heap variables and initialization.
5 ;
6
7         .constructor    initheap, 24
8         .import         __BSS_RUN__, __BSS_SIZE__, __STACKSIZE__
9         .importzp       sp
10
11         .include        "_heap.inc"
12
13
14 .data
15
16 __heaporg:
17         .word   __BSS_RUN__+__BSS_SIZE__        ; Linker calculates this symbol
18 __heapptr:
19         .word   __BSS_RUN__+__BSS_SIZE__        ; Dito
20 __heapend:
21         .word   __BSS_RUN__+__BSS_SIZE__
22 __heapfirst:
23         .word   0
24 __heaplast:
25         .word   0
26
27
28 ; Initialization. Will be called from startup!
29
30 .segment        "ONCE"
31
32 initheap:
33         sec
34         lda     sp
35         sbc     #<__STACKSIZE__
36         sta     __heapend
37         lda     sp+1
38         sbc     #>__STACKSIZE__
39         sta     __heapend+1
40         rts
41
42