How do I locate a constant variable at the end of code area using the Extended Linker ( LX51 ) ? In myfile source, my constant table is declared as: unsigned char code MyTable[10]= { ... } I would like to locate this constant table (by the corresponding segment at the end of my ROM). I use a Philips chip that provides 96kb of ROM mapped from 0x800000 to 0x817FFF. I use the ROM(HUGE) option in compiler and my application is not a banked one... I try with: - ?CO?myfile(0x817000), i have the L108 linker error - ?CO?myfile(^0x817FFF), i have the L108 linker error Could you help me?
In fact, i can use const far type by declaring my table in HCONST by the following way: const char far dummy[4]; With this, i find a ?FC?myfile segment in map file and i can locate it at the end of ROM....OK for this step! But, what about a table of functions declared as below in a source file: code void (void * TableOfFunctions[]) In the same way, i would like to locate also this table at the end of ROM? Can i consider this a table as CONSTANT table and could i move it in HCONST segment? Thank you for the application notes (160) that you send me!
Thank you Alex, It seems to be more clear for me!! But on my example i cannot use const far declaration but only far like this: myfile.c far char dummy[4]; So, in map file i don't find ?FC?myfile segment but ?PR?myfile....Why doest it means? In spite of, could i locate the new ECODE segment at the end of my ROM? Why i cannot use HCONST classe? Thanks you, TONY.
Tony, ?CO? stands for CODE segment/constant. It sounds like you have something declared in code, ex.:
myfile.c char code dummy[4]; ...
myfile.c const far char dummy[4]; ...
80001BH 80001EH 000004H BYTE INSEG HCONST ?FC?MYFILE
817000H 817003H 000004H BYTE INSEG HCONST ?FC?MYFILE
With ?CO?myfile(C:0x817000), i have the following linker message: - ERROR L205: CONSTANT TOO LARGE? What does it means? I cannot locate a constant table outside 0XFFFF address, so only in the first 64kb of ROM? This a chip limitation? Fell free to challenge this! Thanks.
Try: ?CO?(C:0x817000) Stefan
View all questions in Keil forum