Questions:
I'm now using the PICC ME 16,and just found a problem.After compiled the code belowwith the command line -FAKELOCAL -G -E -ASMLIST -16F877,via the watch window,I found address 0x20 and 0x21 which had been allocated to global varible A and B seemed to be reallocated to local varibles of function IncAB().The watch window displayed that varible IncAB.i and IncAB.j taked address 0x20 and 0x21 separately.My question is that why the addresses taken by global varibles were reallocated and how to solve the problem? #includeunsigned char A @0x20; unsigned char B @0x21; void IncAB(void) { unsigned char i; unsigned char j; for(i=0;i<255;i++) A++; for(j=0;j<255;j++) B++; } void main(void) { A=0; B=0; IncAB(); } Best regards
float xdata x; char j; x=0.0; j=1;As x stored in expanded RAM, j will be in on-chip RAM, But the way to access them is the same. As for PIC-based C compilers, we have to do a little more. PICmicros do haven't predefined ALE,WR,RD,but still we could improve compilers to let user define their own ALE,WR or RD pins, and thus make access to expanded RAM easier.