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
char far x;
const char code x[]={1,2,3,4};
const char far x[]={1,2,3,4};
printf("hello");
I don't know of a way to do that. It's on the list of future enhancements but I don't have an ETA on when it will be added. So, for the time being, you'll have to define vars with a far keyword. Thanks Jon, I suspected that would be the case. My suggestion would be to create a #define so you can remove it or tweak it later. Oh of course :-) The code in question is already multi-product and multi-platform (including non-8051 platforms) so there's already lots of #defines in place :-)
Would still appreciate a definitive confirmation from Keil that there is no way to automatically shift all xdata variables, including storage of function call arguments for large functions, into far memory. I don't know of a way to do that. It's on the list of future enhancements but I don't have an ETA on when it will be added. So, for the time being, you'll have to define vars with a far keyword. My suggestion would be to create a #define so you can remove it or tweak it later. Jon
Consult the manual on #pragma STRING(FAR) Thanks, that's exactly what I need. Would still appreciate a definitive confirmation from Keil that there is no way to automatically shift all xdata variables, including storage of function call arguments for large functions, into far memory. I may end up having to move over 1000 variables into far depending on the outcome of some other issues I'm looking into.
Is there any way (automatic or otherwise) to get string literals to go to ECODE or HCONST ? Consult the manual on
#pragma STRING(FAR)
View all questions in Keil forum