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

Local variables (even if designated as xdata) are in code space

Example:
void kfunc(unsigned char * m)
{ unsigned char xdata * k;

REG = *k;
}

If I hover over k, UVision says k = C:0x0000. If I define k as a global no such issues.

Am I missing something here?

Parents
  • Thanks Hans,
    I don't believe it's an issue with misunderstanding the location of the pointer versus the target of the pointer. I've verified that I actually get incorrect behavior (pulling 0s rather than the expected data) when I declare the pointer within a function rather than as a global.

    Thanks,
    Chris

Reply
  • Thanks Hans,
    I don't believe it's an issue with misunderstanding the location of the pointer versus the target of the pointer. I've verified that I actually get incorrect behavior (pulling 0s rather than the expected data) when I declare the pointer within a function rather than as a global.

    Thanks,
    Chris

Children