Memory layout

The current memory layout used by cpik is the following5:
Name Addresses Size Usage
Soft Stack [GG+1->TT]   software stack, grows upward to top of memory
Globals [PP+1->GG]   global variables
Scratch [22->PP] SCRATCH_SIZE-20 returned value area
FP aux [14-21] 8 auxiliary zone for FP routines
Registers [2->13] 12 R0,R1,R2,R3,R4,R5 pseudo-registers
C18_errno [1->1] 1 reserved by libraries
IT mask [0->0] 1 reserved by RTL

There is currently no reserved zone to implement a heap for dynamic memory allocation (malloc(), free()). However such a zone could be obviously implemented at the end of physical memory, and must expand from top (high addresses) to bottom.



Footnotes

... following5
This layout has changed from V0.5.3 to V0.6.0
gibaud 2013-10-30