The VARBANKING directive instructs the compiler to use
alternate library routines that support far memory for classic
To use far memory, you
must configure the memory access functions and an address extension
SFR in XBANKING.A51
and include this file in your project. As alternative, set
?B_VARBANKING in the L51_BANK.A51
bank switch configuration file.
VARBANKING(1) adds code to interrupt service routines to
save and restore the address extension SFR. Specifically, the
following instructions are inserted at the beginning of an interrupt
The symbol ?C?XPAGE1SFR is typically defined in file
XBANKING.A51 and specifies the memory location of the address
extension SFR. The initial value of this SFR is specified by the
?C?XPAGE1RST symbol. Note that not every version of the
XBANKING.A51 requires to save and restore an address extension
SFR and therefore sometimes the symbol ?C?XPAGE1SFR does not
The examples in \KEIL\C51\EXAMPLES\FARMEMORY\ show how to
use the C51 far memory type on classic 8051 devices.
Only interrupt functions in C modules that are translated with
the VARBANKING (1) directive save and restore the address
extension SFR. If your application contains interrupt routines from
assembly modules or libraries you must check them manually.