HT46R01A
Memory Pointers - MP0, MP1
0
0
0
0
0
0
0
0
0
0
0
1
2
3
4
5
6
7
8
9
H
H
H
H
H
H
H
H
H
H
I
n
d
i
r
e
c
t
A
d
d
r
e
s
s
i
n
g
R
e
g
i
s
t
e
r
0
M
P
0
Two Memory Pointers, known as MP0 and MP1 are pro-
vided. These Memory Pointers are physically imple-
mented in the Data Memory and can be manipulated in
the same way as normal registers providing a conve-
nient way with which to address and track data. When
any operation to the relevant Indirect Addressing Regis-
ters is carried out, the actual address that the
microcontroller is directed to, is the address specified by
the related Memory Pointer, bit 7 of the Memory
Pointers is not required to address the full memory
space. It must be noted that when bit 7 of the Memory
Pointers for these devices is read, a value of ²1² will be
returned. The following example shows how to clear a
section of four Data Memory locations already defined as
locations adres1 to adres4.
I
n
d
i
r
e
c
t
A
d
d
r
e
s
s
i
n
g
R
e
g
i
s
t
e
r
1
M
P
1
A
C
C
P
C
L
T
B
L
P
T
B
L
H
W
D
T
S
0
0
A
B
H
H
S
T
A
T
U
S
I
N
T
C
0
0
C
H
0
D
H
T
M
R
0
0
E
H
T
M
R
0
C
0
F
H
H
H
H
H
H
H
S
p
e
c
i
a
l
P
u
r
p
o
s
e
D
a
t
a
M
e
m
o
r
y
1
1
1
1
1
1
0
1
2
3
4
5
P
A
P
A
C
P
A
P
U
P
A
W
K
1
1
1
1
6
7
8
9
H
H
H
H
C
C
T
T
R
R
L
L
0
1
A
D
R
A
D
C
R
1
1
A
B
H
H
A
C
S
R
1
C
H
H
P
W
M
1
D
1
E
H
1
F
H
2
0
H
G
e
n
e
r
a
l
P
u
r
p
o
s
e
:
U
n
u
s
e
d
,
D
a
t
a
M
e
m
o
r
y
r
e
a
d
a
s
"
0
0
"
(
6
4
B
y
t
e
s
)
5
F
H
Special Purpose Data Memory
data .section ¢data¢
adres1
adres2
adres3
adres4
block
db ?
db ?
db ?
db ?
db ?
code .section at 0 ¢code¢
org 00h
start:
mov a,04h
mov block,a
mov a,offset adres1; Accumulator loaded with first RAM address
; setup size of block
mov mp0,a
; setup memory pointer with first RAM address
loop:
clr IAR0
inc mp0
sdz block
jmp loop
; clear the data at address defined by MP0
; increment memory pointer
; check if last memory location has been cleared
continue:
The important point to note here is that in the example shown above, no reference is made to specific Data Memory ad-
dresses.
Rev. 1.10
11
August 13, 2008