12.07.2015 Views

Rabbit 2000™ Microprocessor - UTN

Rabbit 2000™ Microprocessor - UTN

Rabbit 2000™ Microprocessor - UTN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.2.1 DefinitionsExtended Code: Instructions addressed in the extended memory segment.Extended Constants: C constants addressed in the extended memory segment. They are mixedtogether with the extended code.Extended Memory: Logical addresses above 0xDFFF.Extended RAM: RAM not used for root variables or stack. Extended memory in RAM may beused for large buffers to save root RAM space. The function xalloc() allocates space inextended RAM memory.Root Code: Instructions addressed in the root memory segment.Root Constants: C constants, such as quoted strings or data tables, addressed in the root memorysegment.Root Memory: Logical addresses below 0xE000.Root Variables: C variables, including structures and arrays that are not initialized to a fixedvalue, are addressed in the data segment.5.2.2 The Root Memory SegmentThe root memory segment has a typical size of 24K. The larger the root memory segment, thesmaller the data segment and vice-versa. Root memory segment address zero is always mapped to20-bit address zero. Usually the root memory segment is mapped to flash memory since root codeand root constants do not change except when the system is reprogrammed. It may be mapped toRAM for debugging, or to take advantage of the faster access time offered by RAM.The root memory segment holds a mixture of code and constants. C functions or assembly languageprograms that are compiled to the root memory segment are interspersed with data constants.Data constants are inserted between blocks of code. Data constants defined inside a Cfunction are put before the end of the code belonging to the function. Data constants defined outsideof C functions are stored as encountered in the source code.Except in small programs, the bulk of the code is executed using the extended memory segment.But code in the root memory segment operates slightly faster, also the root memory segment hasspecial properties that make it better for some types of code.5.2.2.1 Types of Code Best-Suited for the Root Memory Segment• Short subroutines of about 20 instructions or less that are called frequently will use significantlyless execution time if placed in root memory because of the faster calling linkage for 16-bit versus 20-bit addresses. For a call and return, 20 clocks are used compared to 32 clocks.• Interrupt routines. Interrupts use 16-bit addressing so the entry to an interrupt routine must bein root.• The BIOS core. The initialization code of the BIOS must be at the start of the root memorysegment.Designer’s Handbook 25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!