Samsung KS57C2308 Manual page 35

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
SELECT BANK REGISTER (SB)
The select bank register (SB) is used to assign the memory bank and register bank. The 8-bit SB register
consists of the 4-bit select register bank register (SRB) and the 4-bit select memory bank register (SMB), as
shown in Figure 3-2.
During interrupts and subroutine calls, SB register contents can be saved to stack in 8-bit units by the PUSH SB
instruction. You later restore the value to the SB using the POP SB instruction.
SB
REGISTER
Select Register Bank (SRB) Instruction
The select register bank (SRB) value specifies which register bank is to be used as a working register bank. The
SRB value is set by the "SRB n" instruction, where n = 0, 1, 2, 3.
One of the four register banks is selected by the combination of ERB flag status and the SRB value that is set
using the "SRB n" instruction. The current SRB value is retained until another register is requested by program
software. PUSH SB and POP SB instructions are used to save and restore the contents of SRB during interrupts
and subroutine calls.
RESET
Select Memory Bank (SMB) Instruction
To select one of the four available data memory banks, you must execute an SMB n instruction specifying the
number of the memory bank you want (0, 1 or 15). For example, the instruction "SMB 1" selects bank 1 and
"SMB 15" selects bank 15. (And remember to enable the selected memory bank by making the appropriate EMB
flag setting.
The upper four bits of the 12-bit data memory address are stored in the SMB register. If the SMB value is not
specified by software (or if a
value to logic zero.
The PUSH SB and POP SB instructions save and restore the contents of the SMB register to and from the stack
area during interrupts and subroutine calls.
SMB (F83H)
SMB 3
SMB 2
SMB 1
Figure 3-2. SMB and SRB Values in the SB Register
clears the 4-bit SRB value to logic zero.
does not occur) the current value is retained.
RESET
SRB (F82H)
SMB 0
0
0
ADDRESSING MODES
SRB 1
SRB 0
clears the 4-bit SMB
RESET
3-5

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents