rolox
Joined: 25 Dec 2014 Posts: 33
|
|
Posted: Fri Jan 09, 2015 2:58 am |
|
|
did a small test program
in compiler Rev 5.036, the two testpointer 1+2 have the highbyte zero,
but should be 0x3F. LowByte i correct - verified with program memory
The testpointer3 to a int32 in rom is ok.
Direct access on the Data via Index is ok too - but i need pointer to switch Data
This worked in 5.012 - maybe the declaration of ROM data must be changed ?
| Code: | #include <16f1788.h>
#device *=16
#device ICD=TRUE
#DEVICE PASS_STRINGS=IN_RAM
#fuses NOWDT,NOPROTECT,NOLVP, NOPUT
#use delay(internal=16000000)
int32 rom myConst =123456;
char rom Data1[] = {7,8, 9,10, 11,};
char rom Data2[5] ={20,21,22,23,24,};
void main()
{
int8 dummy=0;
rom char *testpointer1 =&Data1[0];
rom char *testpointer2 =&Data2[0];
rom int32 *testpointer3 =&myConst;
char d0 = Data1[0];
char d1 = Data1[1];
char d2 = Data1[2];
char d3 = Data1[3];
char e0 = Data2[0];
char e1 = Data2[1];
char e2 = Data2[2];
char e3 = Data2[3];
//dummy to set a breakpoint
dummy=1;
char c0 = &testpointer1++;
char c1 = &testpointer1++;
char c2 = &testpointer1++;
char c3 = &testpointer1++;
//dummy to set a breakpoint
dummy=2;
} |
|
|