Table of Contents
Previous topic Next topic
CROSS ASSEMBLER->Memory Bank Switching->Bank Switching Method
The assembler supports bank switching enabling code and data to be located in switchable memory banks. This enables programs using more than 64k of memory to be created. Up to 256 separate code banks and up to 256 separate data banks are supported.
There are two operations required to enable code bank switching:
Unless the output file format is IEEE695, the linker will generate separate files for each bank of code. These will be named <output filename>.bankn where <output filename> is the name of the unbanked program file and n is the bank number. The exception to this is code bank zero which will be combined with the unbanked program file, enabling you to program the unbanked code and the bank zero code into a single rom chip. (If you do not want this, then simply avoid using code bank 0).
- use the SECTION directive in your C source code files to indicate which banks your code and data should be placed in
- tell the linker the address range of each code and data bank.
An IEEE695 format output file will combine all banked and unbanked code into a single file.
This only applies to code sections since data sections are not output to the program file.