KS57C2308/P2308/C2316/P2316 ADDRESSING MODES
3-3
EMB AND ERB INITIALIZATION VALUES
The EMB and ERB flag bits are set automatically by the values of the RESET vector address and the interrupt
vector address. When a RESET is generated internally, bit 7 of program memory address 0000H is written to the
EMB flag, initializing it automatically. When a vectored interrupt is generated, bit 7 of the respective vector
address table is written to the EMB. This automatically sets the EMB flag status for the interrupt service routine.
When the interrupt is serviced, the EMB value is automatically saved to stack and then restored when the
interrupt routine has completed.
At the beginning of a program, the initial EMB and ERB flag values for each vectored interrupt must be set by
using VENT instruction. The EMB and ERB can be set or reset by bit manipulation instructions (BITS, BITR)
despite the current SMB setting.
++ PROGRAMMING TIP — Initializing the EMB and ERB Flags
The following assembly instructions show how to initialize the EMB and ERB flag settings:
ORG 0000H ; ROM address assignment
VENT0 1,0,RESET ; EMB 1, ERB 0, branch RESET
VENT1 0,1,INTB ; EMB 0, ERB 1, branch INTB
VENT2 0,1,INT0 ; EMB 0, ERB 1, branch INT0
VENT3 0,1,INT1 ; EMB 0, ERB 1, branch INT1
VENT4 0,1,INTS ; EMB 0, ERB 1, branch INTS
VENT5 0,1,INTT0 ; EMB 0, ERB 1, branch INTT0
RESET
BITR EMB