To get a program to fit I have in the past resorted to using multiple smaller arrays as a workaround to not being able to fit a single large one.
Was this with uC's that use bankswitching, so don't have one large memorymodel but multiple small ones?
PIC16F. Don't know about "bankswitching". All I can find in the compiler reference manual on these topics is the following:
Out of ROM, A segment or the program is too large
A function and all of the INLINE functions it calls must fit into one segment (a hardware code page). For example, on the PIC16 chip a code page is 512 instructions. If a program has only one function and that function is 600 instructions long, you will get this error even though the chip has plenty of ROM left. The function needs to be split into at least two smaller functions. Even after this is done, this error may occur since the new function may be only called once and the linker might automatically INLINE it. This is easily determined by reviewing the call tree. If this error is caused by too many functions being automatically INLINED by the linker, simply add a #SEPARATE before a function to force the function to be SEPARATE. Separate functions can be allocated on any page that has room. The best way to understand the cause of this error is to review the call tree.
How can a constant data table be placed in ROM?The compiler has support for placing any data structure into the device ROM as a constant read-only element. Since the ROM and RAM data paths are separate in the PICĀ® , there are restrictions on how the data is accessed. For example, to place a 10 element BYTE array in ROM use:
BYTE CONST TABLE [10]= {9,8,7,6,5,4,3,2,1,0};
and to access the table use:
x = TABLE
;
OR
x = TABLE [5];
BUT NOT
ptr = &TABLE ;
In this case, a pointer to the table cannot be constructed.
Similar constructs using CONST may be used with any data type including structures, longs and floats.
Note that in the implementation of the above table, a function