ADDRESS SPACES KS57C2308/P2308/C2316/P2316
2-18
EMB FLAG (EMB)
The EMB flag is used to allocate specific address locations in the RAM by modifying the upper 4 bits of 12-bit
data memory addresses. In this way, it controls the addressing mode for data memory banks 0, 1 or 15.
When the EMB flag is "0", the data memory address space is restricted to bank 15 and addresses 000H–07FH of
memory bank 0, regardless of the SMB register contents. When the EMB flag is set to "1", the general-purpose
areas of bank 0, 1 and 15 can be accessed by using the appropriate SMB value.
++ PROGRAMMING TIP — Using the EMB Flag to Select Memory Banks
EMB flag settings for memory bank selection:
1. When EMB = "0":
SMB 1;Non-essential instruction since EMB = "0"
LD A,#9H
LD 90H,A ;(F90H) A, bank 15 is selected
LD 34H,A ;(034H) A, bank 0 is selected
SMB 0;Non-essential instruction since EMB = "0"
LD 90H,A ;(F90H) A, bank 15 is selected
LD 34H,A ;(034H) A, bank 0 is selected
SMB 15 ;Non-essential instruction, since EMB = "0"
LD 20H,A ;(020H) A, bank 0 is selected
LD 90H,A ;(F90H) A, bank 15 is selected
2. When EMB = "1":
SMB 1;Select memory bank 1
LD A,#9H
LD 90H,A ;(190H) A, bank 1 is selected
LD 34H,A ;(134H) A, bank 1 is selected
SMB 0;Select memory bank 0
LD 90H,A ;(090H) A, bank 0 is selected
LD 34H,A ;(034H) A, bank 0 is selected
SMB 15 ;Select memory bank 15
LD 20H,A ;Program error, but assembler does not detect it
LD 90H,A ;(F90H) A, bank 15 is selected