CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

String/array crossing page/segment border
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rolox



Joined: 25 Dec 2014
Posts: 33

View user's profile Send private message

PostPosted: Fri Jan 09, 2015 2:58 am     Reply with quote

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;
   
}
rolox



Joined: 25 Dec 2014
Posts: 33

View user's profile Send private message

PostPosted: Thu Jan 15, 2015 5:15 am     Reply with quote

solved : ROM Pointer in 5.036 wrong
I posted the problem to CCS support - the said it will be fixed in the next revision
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group