SX Users Manual Rev. 3.1
26
© 2000 Scenix Semiconductor, Inc. All rights reserved.
www.scenix.com
Chapter 2 Architecture
memory for indirect addressing. In this mode, the global register bank and Bank 1 through Bank F are
accessible. Bank 0 is not accessible.
For direct addressing (fr=01-0F), the value of fr itself specifies the register to be accessed, and the
FSR register is ignored. For this addressing mode, only the global register bank is accessible. To gain
access to any other bank, you must use either indirect or semi-direct addressing.
For semi-direct addressing (fr=10-1F), the bank number is selected by the four high-order bits of
FSR, and the register within that bank is selected by the four low-order bits of fr. In other words,
the register address is obtained by combining the four high-order bits of FSR with the four low-order
bits of fr. In this addressing mode, the low-order bits of FSR are ignored. Bank 0 through Bank F
are accessible, but the global register bank is not accessible.
Figure 2-2 shows how register addressing works in the indirect, direct, and semi-direct modes. The 16
global registers are always accessible by direct addressing, regardless of what is contained in the FSR
register. The global registers are also accessible with indirect addressing, but they are not accessible
with semi-direct addressing. Of the 16 global registers, nine are special-purpose registers (RTCC, PC,
STATUS, and so on), and six are general-purpose registers. Location 00 is used for indirect address-
ing (INDF). All of the registers in Bank 0 though Bank F are general-purpose registers.
To change the contents of the FSR register, the program can either write an eight-bit value to the FSR
register or use the bank instruction. The bank instruction writes the three high-order bits (4, 5,
and 6) in the FSR register. Bit 7 of FSR is used to select the upper or lower bank of memory banks.
Thus, to change from one upper bank to another, only a single bank instruction is required. To
change from one upper bank to a lower bank, the bank instruction must be followed by setb
FSR.7.