I build a C51 program and want to show someone else how the pdata variable is stores in C51. The result seemed there exit some problem. I found if I select non on-chip XRAM such as Philips P89C51, the simulator works right as I expected. However, if I select on-chip XRAM MCU such as P89C61x2 or P89C51RA2, no matter how I setting BL51 and modify PPAGEENABLE, PPAGE and PPAGE_SFR in STARTUP.A51, the access of my defined pdata variable in keil simulator always fixed in external ram address 0x0000-0x00ff. How can I disable on-chip XRAM and enable a block of external 256-byte off-chip RAM as pdata access area. Thanks a lot.
You've dug yourself a hole there, I think. PDATA access to banks other than zero relies on setting P2 to choose a bank. Somewhat obviously, that won't have any effect on internal XRAM, which doesn't use P2 as address lines A8..A15. You can't have the cake (conserve port pins for other usage by not using them as the external memory bus), and eat it (use P2 to select PDATA pages), too.