;; ---------------------------------------------------------------------- ;; heap_top.s — defines the absolute upper bound of the heap. ;; ;; This file is built PER-PROGRAM (not bundled into sprinter.lib) so the ;; value of ___sdcc_heap_end can be overridden without re-assembling the ;; library or the user's crt0. sprinter-cc may regenerate this file in ;; its working dir with a custom value when `--stack-size N` is passed; ;; otherwise the default below applies. ;; ;; malloc takes &___sdcc_heap_end as the upper bound of the free-list, ;; so the symbol's address (== the equate value) IS the heap ceiling. ;; ;; 0xBFFE — stack top (init SP in crt0) ;; 0xBB00 — heap top (default) → ~1278 bytes reserved for the stack ;; ... — heap grows up to here from end-of-BSS ;; end-of-BSS — heap start ;; ---------------------------------------------------------------------- .module sprinter_heap_top ___sdcc_heap_end = 0xBB00 .globl ___sdcc_heap_end