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

Defaulting to HCONST and HDATA

C51 v7.20, Dallas DS80C400 in contiguous mode.
(not a regular 8051 memory architecture)

Using the LARGE memory model, is it possible to get the compiler to automatically assign variables to the HDATA class without specifying "far" everywhere?

char x; // goes to xdata by default
Obviously I can change it to:
char far x;
but I'd like to avoid that if possible and a scan of the archives here suggests that I'm going to have to use "far" everywhere. Can Keil confirm this please?




Likewise, is it possible to get constants going to the HCONST class instead of CODE?

The more conventional:
const char code x[]={1,2,3,4};
has to be replaced with:
const char far x[]={1,2,3,4};
If this has to be done, then fine - I can live with that - but is there a way to make "code" automatically go to "far" ? (other than #define code far (which I haven't tried yet because it will probably mess up other stuff)).




Perhaps more importantly:
printf("hello");
The string literal "hello" goes to CODE. Is there any way (automatic or otherwise) to get string literals to go to ECODE or HCONST ?

0