I am using the Dallas 80C400 processor in contiguous mode (16mb memory space). PK51 development kit. My compiler is 7.50
In a most simplistic form, I am doing this:
#pragma string(far) typedef struct { unsigned char *help_txt[15]; } helpsystem; helpsystem const far help_table_E[] = { // 0x20 {"x","y","c","t","","","","","","","","","","",""}, // 0x21 {"","","","","","","","","","","","","","",""}, // 0x22 {"","","","","","","","","","","","","","",""}, };
I am finding that when compiled, and loaded, that the structure itself AND the strings are being allocated the same memory addresses. If I remove the "string(far)" and allow the strings to go to the code segment, then the structure, which is still is far memory, now points correctly to the strings, at their addresses in the code segment. The only problem is I have a ton of strings, way more than 64k worth, so they will not all fit in the code segment. The actual size of "help_table_E" is a lot larger than shown in the example, and there are four other tables like it, each with several hundred structure records, pointing to hundreds of different 15 line strings. I need the strings located in far memory. Somehow the compiler is running independent program counters, one for where the structure goes, and one for where the strings go, and this is causing the problem.
I know this is a little hard to explain, and I wish I could show you the actual results that I see using my in circuit emulator, but I'm hoping somebody knows what I'm talking about here and can tell me why the structure and the strings want to use the same memory locations when string(far) is used.