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

xdata pointer as function parameter

I'm pretty sure I know the answer to my question, but I like verification.

Say I have an array in xdata:

unsigned char xdata foo[32];

I have a function which accepts a pointer and does stuff with it:

void doSomething(unsigned char *ptr, ...) {}

Now, if I pass a pointer to foo to my function:

doSomething(foo, ...);

will accesses to/from ptr in the function use MOVX or will the whole thing blow up?

Or do I need to be explicit about how I write the doSomething function header:

void doSomething(unsigned char xdata *ptr, ...)

I suppose I could make foo[] a global, but I'm trying to keep this generic.

-a

0