Hi David, use the "dw" assembler directive. ie: data dw 0x02324, 0x02425, 0x03233... It will store the data in the format you want into program memory and can be read using the EEPROM program memory read commands. myke ----- Original Message ----- From: David Williams To: Sent: Thursday, October 14, 1999 9:47 AM Subject: Inefficient use of Program Memory in PIC16F877 > Hello all, > I have a question. I have a bunch of data that is 14 bits in size. I'm > using Hitech PIC-C so I've placed the data in an integer. I've done > something like this: > > const int data[256] = {0x2324,0x2425,0x3233, ..... }; > > So I compile and I notice that in the program memory ROM the data is > stored like this: > > 3F24 3F23 3F25 3F24 .... > > Look at all that space that could be used. My 256 array takes up 512 > words of program memory. Now my data is only 14 bits big. Is there > anyway I can delcare a variable 14 bits in size such that my constant > table of data that is 256 14bit words big could be stored in 256 words of > program memory? > > Same goes for charaters. If I never plan to use characters with an ASCII > value greater than 127, then can I find some efficent way to store these > 7bit characters in program memory without using 1 word per character. Ie > stick two 7bit characters in 1 word of program memory. > > Note: I don't want to use the write to and read from program memory > capabilities of the PIC16F877 because that would just cause more code to > be writen and hence more program memory occupied. Soemthing like the > const expression which stores values in ROM is what I'm looking for. > > Thanks > Dave >