IN assembler, I can define as follows: TABLE_CONSTANTS: DB 0x7,0x18,0x18,0x24,0x24,0x7e DB 0x42,0x42, 0x00,0x00 For Keil C program, I can define the above as follows: char xdata table_constants[] = { 0x7,0x18,0x18,0x24,0x24,0x7e, 0x42,0x42,0x00,0x00 } The DB directive in assembler stores byte constants in program memory space where as the C code stores the table in ERAM space. I want to force the table_constant array to use program memory space (CSEG). How can I do this in Keil 'C' and force the compiler to put the table in Program memory space?
Use the "code" memory qualifier instead of "xdata": char code table_constants[] = { 0x7,0x18,0x18,0x24,0x24,0x7e, 0x42,0x42,0x00,0x00 }
Time to read the Manual - C51 supports a full set of these memory-space qualifiers!