errors on the while line with something about the types being compared aren't the same.
I wondered if it was assuming a rom pointer and so I changed the assignment to *point = &INDF0; to force it to a ram pointer. This warned of a suspicious pointer conversion - volatile to non volatile!!
I have now changed it back and it compiles fine.
Does anyone know how to tell this stupid compiler what kind of pointer you want?
I must say that first impressions of XC8 are not good.
Edit, forgot, this compiled fine on a 18F14K50 and only errored on a 16F1823.
Edit2, just found in the manual that you should never compare pointers to constants. So, how do I write the above code? It's basically reading the first 128 bytes of RAM.
I found several similar issues when using MPLABX..... Once or twice I have tried to compile a piece of code in MPLABX with a load of stress bolted on.... Recompiled in MPLAB IDE 8.x and have had no problems at all.
C:
void SeedRand(void){
char x =0;
char*point=0;
while( x ++<128){
Seed.bytes.byte3^=*point++;
if(Seed.bytes.byte3&0x80){
Seed.word<<=1;
Seed.word+=1;
}else
Seed.word<<=1;
}
}
PIC16 memory is not flat. It is divided into banks, each bank spans 128 bytes, but only 80 bytes are useable. When you address it through a pointer (FSR) it will go through the entire 128 bytes for each bank.
The useable 80-byte portions of the banks are mapped together into a linear region at address 0x2000 (as I remeber) were they come one after another. So, to get a 256 bytes of continuous memory, you need to start from 0x2000.