cpik generates code for PIC-18 processors running in legacy (ie: non-enhanced) mode.
The PIC-18 core is fundamentally a 8 bit processor with 16 bit pointers and distinct program/data spaces.
From the C programmer point of view, up to 64K bytes of program space and 64K bytes of data space are available.
Pointers generally point to data space, but pointers to function point
to program space.
Programs can be larger than 64K bytes (when the device has enough memory), but pointers to functions can only reach the lower 64 KB of memory. This is not an issue because it is easy to force the addresses of target functions to be less than
0xFFFF.
cpik has been designed to produce a stack-based code. This kind of code is easy to understand, robust and
potentially reentrant without any trick. Interruptions are easy to support (see section 12.12.5 for details).
Thanks to auto-incremented and indirect addressing modes, this design leads to efficient code.
The memory model is flat and covers the totality of program/data spaces.
There is no banks, "small" stacks, "far" pointers or other tricky ways to save memory but to confuse everybody.
Subsections
Alain Gibaud
2015-07-09