]> git.sur5r.net Git - cc65/blob - libsrc/common/_heap.s
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / libsrc / common / _heap.s
1 ;
2 ; Ullrich von Bassewitz, 03.06.1998
3 ;
4 ; Heap variables and initialization.
5 ;
6
7         .export         __horg, __hptr, __hend, __hfirst, __hlast
8         .export         __hinit
9         .import         __BSS_RUN__, __BSS_SIZE__, __stksize
10         .importzp       sp
11
12 .data
13
14 __horg:
15         .word   __BSS_RUN__+__BSS_SIZE__        ; Linker calculates this symbol
16 __hptr:
17         .word   __BSS_RUN__+__BSS_SIZE__        ; Dito
18 __hend:
19         .word   __BSS_RUN__+__BSS_SIZE__
20 __hfirst:                
21         .word   0
22 __hlast:
23         .word   0
24
25
26 ;
27 ; Initialization. Must be called from startup!
28 ;
29
30 .code
31
32 __hinit:
33         sec
34         lda     sp
35         sbc     __stksize
36         sta     __hend
37         lda     sp+1
38         sbc     __stksize+1
39         sta     __hend+1
40         rts
41
42
43
44
45