SINGLE COMPONENT SYSTEM
There are three locations
in
Program Memory
of
special importance:
LOCATION 0
Activating the
Reset
line of the processor
causes the first instruction to
be
fetched
from location
O.
LOCATION 3
Activating the Interrupt input
line of the
processor (if interrupt
is
enabled) causes a
jump
to
subroutine at location
3.
LOCATION 7
A timer/counter interrupt resulting from
timer/counter overflow (if enabled) causes
a jump
to
subroutine at location
7.
Therefore, the first instruction to
be
executed
after initialization is stored
in
location
0,
the
first word of
an
external interrupt service
subroutine
is
stored
in
location
3,
and
the first
word of a timer/counter service routine is
stored
in
location
7.
Program memory
can
be
used
to
store constants
as
well
as
program
instructions. Instructions such
as
MOVP
and
MOVP3 allow easy access
to
data "lookup"
tables.
Data Memory
Resident data memory
is
organized
as
64
or
128 words 8-bits wide.
All locations are
indirectly addressable through either of
two RAM Pointer Registers which reside at
address 0 and 1 of the register array.
In
addition, the first 8 locations (0-7) of the
array are designated
as
working registers
and are directly addressable by
several
instructions. Since these registers are more
easily addressed, they are usually used to
store frequently accessed intermediate
results. The
DJNZ instruction makes very
efficient use of the working registers
as
pro-
gram loop counters by allowing the
programmer to decrement and test the
register in a
single instruction.
By
executing a Register Bank Switch instruc-
tion (SEL RB) RAM locations 24-31 are
designated
as
the working registers
in
place
of locations 0-7
and
are then directly address-
able.
This second bank of working registers
may
be
used
as
an
extension of the first bank
or reserved for use during interrupt service
2-3
-0
2048~
,
SELMai
2047~
TSELMBO
1024
1023
--""""""
..
..
716151413121110
o
ADDRESS
r--
r---
I--
LDCATION 7 - TIMER
INTERRUPT VECTORS
PROGRAM HERE
LOCATION 3 - EXTERNAL
INTERRUPT VECTORS
PROGRAM HERE
RESET
VECTORS
PROGRAM
HERE
MCS-48™ PROGRAM MEMORY MAP
63
(128
)
32
31
2.
23
USER
RAM
3h8
(96.8)
BANK
I
WORKING
REGISTERS
ax8
- - -
-RT'
- - - -
- - -
-ROo
- - - -
B
LEVEL
STACK
OR
USER
RAM
16 x 8
BANKO
WORKING
REGISTERS
ax8
r----------
----~-
----
I
DIRECTLY
ADDRESSABLE
WHEN
BANK
1
IS SELECTED
-.J
ADDRESSED
INDIRECTLY
THROUGH
Rl
OR
RO
(RO' OR
Rl')
I
DIRECTLY
ADDRESSABLE
WHEN
BANK
0
IS SELECTED
IN
ADDITION
RO
OR
Rl
(RO'
OR
Rl')
MAY
BE
USED TO ADDRESS 268 WORDS OF
EXTERNAL
RAM.
(
)8049
only
DATA MEMORY MAP