Re: microcontrollers
With a microcontroller (like the 8051) the first decision is which memory model to use.
Whereas the PC programmer chooses between TINY, SMALL, MEDIUM, COMPACT, LARGE and HUGE to control how the processor segmentation of the RAM is to be used (overcome!), the 8051 user has to decide where the program and data are to reside.
Some compilers supports the following memory configurations:
ROM: currently the largest single object file that can be produced is 64K, although up to 1MB can be supported with the BANKED model described below. All compiler output to be directed to Eprom/ROM, constants, look-up tables etc., should be declared as "code".
RAM: There are three memory models, SMALL, COMPACT and LARGE
SMALL: all variables and parameter-passing segments will be placed in the 8051's internal memory.
COMPACT: variables are stored in paged memory addressed by ports 0 and 2. Indirect addressing opcodes are used. On-chip registers are still used for locals and parameters.
LARGE: variables etc. are placed in external memory addressed by @DPTR. On-chip registers are still used for locals and parameters.
BANKED: Code can occupy up to 1MB by using either CPU port pins or memory-mapped latches to page memory above 0xFFFF. Within each 64KB memory block a COMMON area must be set aside for C library code. Inter-bank function calls are possible.