If it's anything like any of the embedded systems which I've worked with (including Renesas, for the H8), this copy is done for you in a startup assembly file which eventually calls your main. You can access the region with the symbols provided (and naseeam is probably right, these are labels with no size), but the actual copy is done for you before your main starts.
Easy way to check if it is: Run a tiny sample progam under your debugger, like this:
unsigned char i = 7;
unsigned char j;
int main(void)
{
if (i == j)
j = 1;
else
j = 2;
}
break at your main, and look at the values of i and j. If i is 7 and j is 0, then both the copy of the initialized variables has been done, as well as the zeroing of the uninitialized ones.
Main Topics
Browse All Topics





by: naseeamPosted on 2007-05-30 at 14:23:51ID: 19183599
I think extern should be arrays as follows:
extern unsigned char __TOP_D[];
extern unsigned char __TOP_ROM_D[];
extern unsigned char __END_D[];