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

Can�t allocate multiple Byte CONST tables: CORRECTED POST

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
julioc
Guest







Can�t allocate multiple Byte CONST tables: CORRECTED POST
PostPosted: Sat Mar 25, 2006 9:20 am     Reply with quote

Hi, correcting a cut-and-paste error of the previous version of this post:

I am using a 16F688 and I have a need for storing 64 tables of 17 bytes each one.
At first I tried to merge those 64 tables in single a big table like this:

BYTE CONST T_TMAP [64 * 17] =
{ /* ... */ };

But it didnt even compile, because the preamble code that the compiler automatically inserts to access table element can�t deal with more than 255 elements.
OK, then I tried to split the big table into 8 smaller tables, like this:

BYTE CONST T_TMAP0 [8 * 17] =
{ /* ... */ };
BYTE CONST T_TMAP1 [8 * 17] =
{ /* ... */ };
BYTE CONST T_TMAP2 [8 * 17] =
{ /* ... */ };
BYTE CONST T_TMAP3 [8 * 17] =
{ /* ... */ };
BYTE CONST T_TMAP4 [8 * 17] =
{ /* ... */ };
BYTE CONST T_TMAP5 [8 * 17] =
{ /* ... */ };
BYTE CONST T_TMAP6 [8 * 17] =
{ /* ... */ };
BYTE CONST T_TMAP7 [8 * 17] =
{ /* ... */ };

Well, it compiled fine, no errors or warnings, but... The compiler allocated adequately T_TMAP0 and T_TMAP1 in the ROM, but it simply didnt allocate T_TMAP2 .. T_TMAP7! It should have issued at least an error or warning!

I could notice that this line of my code:
return T_TMAP0 [index];
generates the following assembly table read call : "call 052"

return T_TMAP1 [index];
generates the following assembly table read call : "call 0DE"

and all the lines
return T_TMAPx [index]; // where x = 2, 3, ... 7
generate the same following assembly table read call : "call 0DE"
as if the 6 last tables were all assimilated by the compiler to be identical to T_MAP1 !!

Please, folks, what am I doing wrong, or what workaround should I use to have those tables allocated ?
My compiler version is 3.235.

Thanks!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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