I am porting an application over from the Keil C51 compiler. I am storing some constants in code space and the C51 code is
void say(unsigned char word, unsigned char offset) { unsigned long word_address;
// word address high byte table code unsigned char addresstablehi[] = { 0x00,0x00,0x00,0x00,0x01,0x01,0x04,0x07 ,0x08 } ; . . How do I perform this in CW. The address table values are calculated by another program which produces a text file in the correct format so that I can cut and paste into the compiler, so I would hope the CW code would be similar.
Make your table static const. For globals const alone is enough, but for locals you have to make them static (function static) too, otherwise CW will still allocate them on the stack.