Emergency how to access pointer array located in BANKn?
//Located at BANK0 code char *pStrArray[] = { "1", "2", "34", }; //Located at BANK0 void LoadString(char *strbuf, const char *pString){ BYTE iBank; iBank = get_bank(); switchbank(RES_BANK); strcpy(strbuf, pString); switchbank(iBank); } //Located at BANK1 void GetString(char *strbuf, const char *pStr[], unsiged char i){ LoadString(strbuf, pStr[i]); } //the result is null string, why?
Take a look to the examples provided under \Keil\C51\EXAMPLES\FarMemory. The folder 1MB Constants on Classic 8051 contains an useful starting point. It should be noted that you need PK51 and the extended linker LX51 to use this example programs.