I need to copy some code from the load address to the run address. All of the examples in the documentation show assembly implementation using the .label directive. However, I am using C. In the Freescale part that this code is migrated from, the compiler could access the section\segment with labels that were pre-pended with __SEG_START_labelname & __SEG_SIZE_labelname.
Also, what directive END's a #pragma CODE_SECTION() directive to go back to the default of .text?
How is this access done in the MSP430 compiler? In FScale, this is #pragma CODE_SEG DEFAULT.
See excerpts below.
On a side note, with part memories getting larger, more software is done in C\C++ on embedded systems than before. However, many of the examples in the documentation are shown only in assembly. More C examples would be helpful.
Regards,
Jim
C file excerpt:
#pragma CODE_SECTION (RamVectors, "RAMVECT_SEG")
void RamVectors(void)
{
asm(" JMP UnImplementedIsr ");
asm(" JMP UnImplementedIsr ")
...
}
memcpy(&RamVectors, & ?????, len???);
Command file excerpt:
MEMORY
{
RAM_VECTORS : origin = 0x1100, length = 0x0040
}
SECTIONS
{
RAMVECT_SEG : {} load > FLASH, run > RAM_VECTORS, fill = 0xAA
}