Table of Contents Previous topic Next topic
CROSS ASSEMBLER->Memory Bank Switching->Setting up the Linker
You tell the linker about the available code or data banks using the /ROM or /RAM options.
For example the following linker options tell the linker that there are two code banks number 0, 1 and a data bank numbered 0 each with an address range from 8000 hex to FFFF hex:
/ROM:8000:FFFF:0 /ROM:8000:FFFF:1 /RAM:8000:FFFF:0
The bank numbers correspond to the bank numbers used in the SECTION directive.
If you are using the Embedded Development Studio, then you can use the Advanced option in the linker settings to set up your code banks. Build->Settings->Linker->Advanced.
If you have specified a bankable section in your assembler source but do not specify a range for this bank to the linker, then the linker will warn you that it is ignoring the bank information for that section and will place the section in a non-banked region. Therefore you can easily switch sections into and out banked memory simply by adding or removing the linker option for the relevant bank.