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:0xEFFFVariables too large for on-chip RAM.
ROMC:0x0000–C:0x7FFF
(common area)
Common area program and constant objects.
ROMB0:0x8000–B3:0xFFFF
(code banks)
Bank area program objects..

requires the following linker command line:

LX51 BANK0 {A.OBJ}, &
     BANK1 {B.OBJ}, &
     BANK2 {C.OBJ}, &
     BANK3 {D.OBJ} &
     BANKAREA (0x8000–0xFFFF) &
     SEGMENTS ( &
              IDATA(I:0x00-I:0xFF), &
              CODE(C:0x0000-C:0xEFFF), &
              XDATA(X:0x0000-X:0xEFFF) &
              )

Note

  • The address ranges for the BIT and DATA memory classes in the above linker command line are not required since the default settings cover the correct physical address ranges.