No, copymydatatoRAM is assigned to the outside of PPAGE window 0x8000-0xBFFF. In my experimental project this function landed at 0x4097. Maybe you ignored CODE_SEG pragma from my example or did something to NON_BANKED placement in your PRM file?
All other functions can be allocated to any page. Normally you should not bother what page specific function is allocated to. But what you did to allocate data in paged flash is not enough. Yes, switching CONST_SEG allocation makes data allocated in paged flash, but you should either use LAP pointer to access paged data, or care about 1) switching PPAGE to access paged data and 2) care about NOT switching PPAGE while CPU is executing paged function within PPAGE window, since it would unmap memory with current code from PPAGE window and CPU will runaway. Paged functions are executed from PPAGE window 0x8000-0xBFFF. Having data in different page than code, you need to switch PPAGE, but you can't do it while CPU program counter is within page window. So you need to jump to NON_BANKED routine and switch PPAGE there.
> My program larger than 64Kb,How can I change one Page to another page for program or function?
Do you mean you won't some paged code allocated to specific page? This may be done switching CODE_SEG to specific placement, which is restricted to specific page. You need to define new placement in PLACEMENT section of PRM file. Then use CODE_SEG to switch to this placement.
BTW you may place both paged data access routine and access routine to the same page switching both CODE_SEG and CONST_SEG to the same PLACEMENT INTO PPAGE_x. This way you wouldn eliminate the need to switch PPAGE for data access. But you still can't call functions like strcpy or memcpy, because they may be allocated to different page and won't be able access data properly.
const char *__linear const keys[]={1,2,3,4,5} ; --- Of course this is wrong. Original code defined array of strings. It looks like you want to define either array of chars or array of ints.
#include <mmu_lda.h>#pragma CONST_SEG __LINEAR_SEG PAGED_ROMconst char myconstchars[] = {1,2,3,4,5};const int myconstints[] = {0x101,2,3,4,5};#pragma CONST_SEG DEFAULTvoid main(void) {char c;int i; __LOAD_LAP_ADDRESS(myconstchars); __ADJUST_LAP_IMM_16BIT( 2/* access 3rd element of myconstchars*/); // ^^ _IMM is for immediate constant argument // ^^ _16BIT - width of index variable/constant. __LOAD_BYTE(c); __LOAD_LAP_ADDRESS(myconstints); __ADJUST_LAP_IMM_16BIT( 3*2/* access 4th element of myconstints*/); __LOAD_WORD_INC(i);
It requires a lot of writing in proper English(, which I'm not good at) to explain it all. Hope you'll manage to get it working.