9/84
ST6365, ST6375, ST6385 ST6367, ST6377, ST6387
1.3 MEMORY SPACES
The MCU operates in three different memory
spaces: Stack Space, Program Space and Data
Space.
1.3.1 Stack Space
The stack space consists of six 12 bit registers that
are used for stacking subroutine and interrupt re-
turn addresses plus the current program counter
register.
1.3.2 Program Space
The program space is physically implemented in
the ROM and includes all the instructions that are
to be executed, as well as the data required for the
immediate addressing mode instructions, the re-
served test area and the user vectors. It is ad-
dressed thanks to the 12-bit Program Counter reg-
ister (PC register) and the ST6 Core can directly
address up to 4K bytes of Program Space. Never-
theless, the Program Space can be extended by
the addition of 2Kbyte memory banks as it is
shown in Figure 4, in which the 20K bytes memory
is described. These banks are addressed by point-
ing to the 000h-7FFh locations of the Program
Space thanks to the Program Counter, and by writ-
ing the appropriate code in the Program ROM
Page Register (PRPR) located at address CAh in
the Data Space. Because interrupts and common
subroutines should be available all the time only
the lower 2K byte of the 4K program space are
bank switched while the upper 2K byte can be
seen as static space. Table 3 gives the different
codes that allows the selection of the correspond-
ing banks. Note that, from the memory point of
view, the Page 1 and the Static Page represent
the same physical memory: it is only a different
way of addressing the same location. On the
ST6385 and ST6387, a total of 20480 bytes of
ROM have been implemented; 20140 bytes are
available as User ROM while 340 bytes are re-
served for testing.
Figure 4. 20K-Byte Program Space Addressing
Figure 5. Memory Addressing Diagram
Program
counter
space
0FFFh
0800h
07FFh
0000h
Static
Page
Page 1
Page 0
4FFFh
Page 1
Page 9
Static Page
...
PROGRAM SPACE
ROM
INTERRUPT &
RESET VECTORS
ACCUMULATOR
DATA RAM
BANK SELECT
DATA ROM
WINDOW SELECT
RAM
X REGISTER
Y REGISTER
V REGISTER
W REGISTER
DATA ROM
WINDOW
RAM / EEPROM
BANKING AREA
000h
03Fh
040h
07Fh
080h
081h
082h
083h
084h
0C0h
0FFh
0-63
DATA SPACE
0000h
0FF0h
0FFFh
PROGRAM COUNTER
STACK LEVEL 1
STACK LEVEL 2
STACK LEVEL 3
STACK LEVEL 4
STACK LEVEL 5
STACK LEVEL 6
vr01568
STACK SPACE
ROM
07FFh
0800h