Cosmic UK Cosmic US Cosmic Germany Cosmic Italia Cosmic France


Cosmic Software Frequently Asked Questions


How do I locate a piece of code in ROM and copy it into RAM for execution such as with a boot loader.


Cosmic compilers include a movable code feature that provides an automated mechanism to store code at one address and copies it to a RAM address for execution. This applies to boot loaders and programmers that usually run out of RAM, but are stored in ROM until needed. Using this mechanism, the linker moves selected segments of RAM code to an unused location in ROM to be copied back to RAM at run-time using a supplied function copy library routine. For more details please see the "Moveable Code"section in the linker chapter of the user's manual. The following examples demonstrate the moveable code feature using the the HC12 compiler:
Paged example
Non Paged example