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
  • I think you're mixing up where the pointer is (most likely in data space) with where it points to (xdata).

    The pointer at hand is uninitalized, and has automatic storage, so its value is random garbage. It's impossible to derive any useful conclusion from where it might seem to point.

Reply
  • I think you're mixing up where the pointer is (most likely in data space) with where it points to (xdata).

    The pointer at hand is uninitalized, and has automatic storage, so its value is random garbage. It's impossible to derive any useful conclusion from where it might seem to point.

Children