µVISION DEBUGGER: SIMULATING BANKED XDATA / FAR MEMORY
Information in this knowledgebase article applies to:
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 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
of your data.