User`s manual

26 rabbit.com Rabbit Memory Organization
One advantage of retaining the Rabbit 16-bit logical memory organization is that 16-bit addresses and
pointers can reduce code size and execution times.
NOTE: The relative size of the base and data segments can be adjusted by increasing or
decreasing the BIOS macro DATAORG in increments of 0x1000.
5.2.1 Definition of Terms
The following definitions clarify some of the terms that will be encountered in this chapter.
Extended Code (a.k.a., xmem code): Instructions located in the extended memory segment.
Extended Constants (a.k.a., xmem constants): C constants located in the extended memory segment.
They are mixed together with the extended code.
Extended Memory (a.k.a., xmem): Logical addresses in 0xE000 - 0xFFFF range.
Extended RAM: RAM not used for root variables or stack. Extended memory in RAM may be used for
large buffers to save root RAM space. The Dynamic C compiler supports the far keyword to allow C data
types to be declared and defined in extended memory. The code generation for the far data types makes use
of the expanded Rabbit 4000 instructions and registers. The function xalloc() also allocates space in
extended RAM memory. See the Dynamic C User’s Manual for more information on the far keyword.
Far Constants: C constants declared with the “far” keyword currently located in the extended memory
segment. The location of far constants may be changed in the future.
Root Code: Instructions located in the base segment.
Root Constants: C constants, such as quoted strings, initialized variables or data tables, that are located in
the base segment. Root constants share space with root code unless separate I&D space is enabled.
Root Memory: Logical addresses below 0xE000. Please note that root memory is not the same as the root
segment. The root segment is contained in root memory, as are the data and stack segments. The root seg-
ment is also known as the base segment.
Root Variables: C variables, including structures and arrays that are not initialized to a fixed value, are
located in the data segment.
Table 5-1 Selecting the Quadrant Size
MECR Value
Address Bits Used to
Select Quadrant
Quadrant Size
Physical Address
Space
11100000b A18, A17 128 KB 512 KB
00000000b A19, A18 256 KB 1 MB (default)
00100000b A20, A19 512 KB 2 MB
01000000b A21, A20 1 MB 4 MB
01100000b A22, A21 2 MB 8 MB
10000000b A23, A22 4 MB 16 MB