ADDRESSING MODES

KS57C2308/P2308/C2316/P2316

 

 

ENABLE MEMORY BANK SETTINGS

EMB = "1"

When the enable memory bank flag EMB is set to logic one, you can address the data memory bank specified by the select memory bank (SMB) value (0, 1 or 15) using 1-, 4-, or 8-bit instructions. You can use both direct and indirect addressing modes. The addressable RAM areas when EMB = "1" are as follows:

If SMB = 0,

000H–0FFH

If SMB = 1,

100H–1FFH

If SMB = 15,

F80H–FFFH

EMB = "0"

When the enable memory bank flag EMB is set to logic zero, the addressable area is defined independently of the SMB value, and is restricted to specific locations depending on whether a direct or indirect address mode is used.

If EMB = "0", the addressable area is restricted to locations 000H–07FH in bank 0 and to locations F80H–FFFH in bank 15 for direct addressing. For indirect addressing, only locations 000H–0FFH in bank 0 are addressable, regardless of SMB value.

To address the peripheral hardware register (bank 15) using indirect addressing, the EMB flag must first be set to "1" and the SMB value to "15". When a RESET occurs, the EMB flag is set to the value contained in bit 7 of ROM address 0000H.

EMB-Independent Addressing

At any time, several areas of the data memory can be addressed independent of the current status of the EMB flag. These exceptions are described in Table 3-1.

Table 3-1. RAM Addressing Not Affected by the EMB Value

Address

Addressing Method

Affected Hardware

Program Examples

 

 

 

 

 

000H–0FFH

4-bit indirect addressing using WX

Not applicable

LD

A,@WX

 

and WL register pairs;

 

 

 

 

8-bit indirect addressing using SP

 

PUSH

EA

 

 

 

POP

EA

 

 

 

 

 

FB0H–FBFH

1-bit direct addressing

PSW, SCMOD,

BITS

EMB

FF0H–FFFH

 

IEx, IRQx, I/O

BITR

IE4

 

 

 

 

 

FC0H–FFFH

1-bit indirect addressing using the

BSC, I/O

BTST

FC3H.@L

 

L register

 

BAND

C,P3.@L

 

 

 

 

 

3-4

Page 34
Image 34
Samsung KS57C2308 manual Enable Memory Bank Settings, Emb =, EMB-Independent Addressing