This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Initializing Memory

How do we initialize the XDATA memory with dummy data (e.g. 0xDEADBEEF)?

By default all the memory is initialized to 0x00 during debugging (in the IDE). When you burn your firmware on the controller, the memory holds random values. To be able to detect uninitialized variables, I'd like to initialize the XDATA memory space to a predefined (non-zero) value.

Note that I don't want to overwrite the global static variables (i.e. those that are rightly initialized to a value). E.g.
static unsigned char foo = 0x00.

I guess what I want must be done in INIT.A51, prior to initializing the static variables. Any idea how? Samples welcomed!

0