Keil Logo


Information in this knowledgebase article applies to:

  • PK51 Version 7.01 and later


I have created a project using far variables on a standard 8051 device. I have configured the bank switch module L51_bank.a51 but it seems that the µVision simulator ignores the bank-switch settings and reads/writes those far variables into the standard (non-banked) XDATA memory. Does the µVision simulator correctly simulate far memory accesses?


Yes. The µVision Simulator can simulate multiple XDATA banks but it must be configured for this.

When you enable 'far memory type support' in your µVision project, you need to add either the module L51_BANK.A51 or XBANKING.A51 to your project. The XDATA banking method is defined in these files and the simulator needs to be configured to use the same bank register/address to calculate the correct address. By default, XDATA banking is switched off in the µVision simulator.

On classic 8051 devices, the XPAGE VTREG allows you to specify the XDATA page to use or the SFR register that contains the XDATA page. For example:

  • XPAGE=0xFFFFFFFF: Use default behavior for MOVX @DPTR instructions which means that the XDATA area is limited to 64K and bank information is ignored. (default)
  • XPAGE= Values in the range 0x00 - 0xFF are taken as a fixed XDATA bank.
  • XPAGE= Any other value is taken as address of a SFR register or XDATA address which specifies the XDATA bank number.


XPAGE=0xFFFFFFFF  // Use default behavior for MOVX @DPTR which
                  // means to ignore bank information (default)

XPAGE=0x03        // MOVX @DPTR addresses XDATA bank 3 (X:0x030000+DPTR)

XPAGE=D:0x90      // Use the SFR at D:0x90 (P1) as the
                  // banking register for MOVX @DPTR

XPAGE=X:0x0000    // Use the XDATA address X:0x0000 as the
                  // banking register for MOVX @DPTR

XPAGE=&B_CURRENTBANK // Use the banking register as the
                     // banking register for MOVX @DPTR



Last Reviewed: Wednesday, January 29, 2014

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.