First a short answer. You can probably safely ignore the warning, details below. The result is not as efficient as it could be, but works.
Now the more detailed response
.
For the RS08 in extended (meaning non zero page) memory, the compiler supports 2 kind of accesses.
Paged (segment qualifier __SEG_PAGED, pointer qualifier __paged) and far (segment qualifier __FAR_SEG, pointer qualifier __far).
Far accesses/variables can be located anywhere, they may cross page (meaning multiple of 64) boundaries. For __paged accesses the compiler assumes that there is no page boundary inside of an object.
If an object is bigger than the page size (64), then it has to be __far as there is always a page boundary somewhere. For all object objects though using __paged access is MUCH more efficient, therefore I would suggest to use always __paged with the single exception of objects > 64 bytes, where __far is mandatory.
Back to the warning, the warning if for __paged accesses, but as by default there are no paged accesses (default is the safe but slow and huge __far), the code works. Just not as efficient as it could be.
Also the warning cannot be avoided as far as I know for objects > 64 bytes (I personally find the warning a bit unfortunate, well it is as it is).
For using paged, the requirement that nothing must cross a page boundary is best implemented in the prm file by listing
the used flash as 64 byte blocks.
A sample helps I hope:
#pragma push#pragma CONST_SEG __PAGED_SEG MY_PAGED_SECconst int test0[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};const int test1[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};const int test2[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};#pragma CONST_SEG __FAR_SEG MY_FAR_SECconst int test_far[100] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};#pragma popvolatile int sum;void main(void) { unsigned char i = 0; for (;;) { i++; i %= sizeof(test0)/sizeof(test0[0]); sum = test0[i] + test1[i] + test2[i] + test_far[i]; __RESET_WATCHDOG(); }}
And here the prm parts (for a ka2, adapt to your chip:
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ TINY_RAM = READ_WRITE 0x0005 TO 0x000D; RAM = READ_WRITE 0x0020 TO 0x004F; RESERVED_RAM = NO_INIT 0x0000 TO 0x0004; MY_PAGED_SEG0 = READ_ONLY 0x3800 TO 0x383F; MY_PAGED_SEG1 = READ_ONLY 0x3840 TO 0x387F; MY_PAGED_SEG2 = READ_ONLY 0x3880 TO 0x38BF; ROM = READ_ONLY 0x38C0 TO 0x3FF7;ENDPLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ RESERVED INTO RESERVED_RAM; TINY_RAM_VARS INTO TINY_RAM; DIRECT_RAM_VARS INTO RAM, TINY_RAM; DEFAULT_RAM INTO RAM, TINY_RAM; MY_FAR_SEC, DEFAULT_ROM INTO ROM; MY_PAGED_SEC INTO MY_PAGED_SEG0, MY_PAGED_SEG1, MY_PAGED_SEG2;END
Daniel