Samsung KS57C2308 Manual page 27

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
ERB FLAG (ERB)
The 1-bit register bank enable flag (ERB) determines the range of addressable working register area. When the
ERB flag is "1", the working register area from register banks 0 to 3 is selected according to the register bank
selection register (SRB). When the ERB flag is "0", register bank 0 is the selected working register area,
regardless of the current value of the register bank selection register (SRB).
When an internal
RESET
automatically initializes the flag. When a vectored interrupt is generated, bit 6 of the respective address table in
program memory is written to the ERB flag, setting the correct flag status before the interrupt service routine is
executed.
During the interrupt routine, the ERB value is automatically pushed to the stack area along with the other PSW
bits. Afterwards, it is popped back to the FB0H.0 bit location. The initial ERB flag settings for each vectored
interrupt are defined using VENTn instructions.
+ +
PROGRAMMING TIP — Using the ERB Flag to Select Register Banks
ERB flag settings for register bank selection:
1. When ERB = "0":
SRB
LD
LD
SRB
LD
SRB
LD
2. When ERB = "1":
SRB
LD
LD
SRB
LD
SRB
LD
is generated, bit 6 of program memory address 0000H is written to the ERB flag. This
1
EA,#34H
HL,EA
2
YZ,EA
3
WX,EA
1
EA,#34H
HL,EA
2
YZ,EA
3
WX,EA
; Register bank 0 is selected (since ERB = "0", the
; SRB is configured to bank 0)
; Bank 0 EA
#34H
; Bank 0 HL
EA
; Register bank 0 is selected
; Bank 0 YZ
EA
; Register bank 0 is selected
; Bank 0 WX
EA
; Register bank 1 is selected
; Bank 1 EA
#34H
; Bank 1 HL
Bank 1 EA
; Register bank 2 is selected
; Bank 2 YZ
BANK2 EA
; Register bank 3 is selected
; Bank 3 WX
Bank 3 EA
ADDRESS SPACES
2-19

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents