LX51 User's Guide

Code Banking Example

A code banking application with the following memory map:

Memory
Area
Address
Range
Usage
On-Chip
RAM
I:0x00–I:0xFFRegisters, bits, variables, stack, ...
External
RAM
X:0x0000–X:0x7FFFVariables too large for on-chip RAM.
ROMC:0x0000–C:0x7FFF
(common area)
Program code and constants.
CODE ROMC:0x000000–C:0x03FFFF
(code banks)
Program code and constants.

requires the following linker command line: 

LX51 BANK0 {A.OBJ},
     BANK1 {B.OBJ},
     BANK2 {C.OBJ},
     BANK3 {D.OBJ}
     BANKAREA (0x8000-0xFFFF)
     CLASSES (
             XDATA  (X:0x0000-X:0x7FFF),
             HCONST (C:0x000000-C:0x03FFFF)
             CODE   (C:0x0000-C:0xFFFF)
             )

There are several Application Notes available that show how to create programs for extended 8051 devices.