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.

All origin statements must have a unique ANSI C identifier. The scope of this identifier is only withother origin statements or declarations. In the pre 7.05 syntax this is the .Each memory region is defined by calculating a physical address from an 8-bit base address (firstconstant-expression of physical-address) and a 16-bit logical address (second constant-expression ofphysical-address). The size of the memory region is determined by 20-bit size. Overflow of thesethree values is truncated. In the pre 7.05 syntax these three values are , and .The keywords apply and resume are action-expressions. They tell the compiler to generate codeor data in the memory region specified by identifier. Anapply action resets the code or datapointer for the specified region to the starting physical address of the region and makes the regionactive. A resume action does not reset the code or data pointer, but does make the memory regionactive.A region remains active (i.e., the compiler will continue to generate code or data to it) untilanother region of the same origin-type is activated with an apply or resume action or until thememory region is full.The option follow-expression is best described with an example. First, let us declare yourcodein an origin statement containing an origin-declaration. Afollow-expression can only name aregion that has already been declared in an origin-declaration.#rcodorg yourcode 0x0 0x5000 0x500then the origin statement:#rcodorg mycode 0x0 0x5500 0x500 follows yourcodetells the compiler to activate mycode when yourcode is full. This action does an implicitresume on the memory region identified by yourcode. In this example, the implicit resumealso generates a jump to mycode when yourcode is full. For data regions, the data that wouldoverflow the region is moved to the region that follows. Combined data and code regions (like#rcodorg) use both methods, which one is used depends on whether code or data caused theregion to overflow. In our example, if data caused yourcode to overflow, the data would be writtento the memory region identified by mycode.Furthermore, a follow-expression may specify that when the code or data resumes at the nextregion it should generate a separate bin file. This option is designed to support burning multipleflash or EPROM devices. The binary files generated share the same base name as the original file,but appended with a number which is followed by the .bin extension. For example, if hello.c,alarge program that spans both flash chips, is compiled to file with the splitbin option on,hello1.bin and hello2.bin will be generated. Obviously, this option is only meaningfulwhen compiling to a file.The optional debug-expression is only valid with the xcodorg origin-type. It tells the compiler togenerate only debug or nodebug code in that physical memory region. If debug-expression isnot specified, the declaration is treated as an all region. An all region can have both debugand nodebug code. Activating an all region (by using apply or resume) will cause bothdebug and nodebug regions to become inactive. If an all region is active, both debug andnodebug regions must be made active to entirely deactivate the all region. In other words, if anall region is active and a debug region is activated, any nodebug code will still be generatedto the all region until a nodebug region is made active.Designer’s Handbook 35

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

Saved successfully!

Ooh no, something went wrong!