HT46R46/C46/R47/C47/R48A/C48A/R49
Rev. 1.41
14
December 30, 2008
The following example shows how to clear a section of four RAM locations already defined as locations adres1 to
adres4.
data .section
¢
data
¢
adres1
db ?
adres2
db ?
adres3
db ?
adres4
db ?
block
db ?
code .section at 0
¢
code
¢
org
00h
start:
mov
a,04h
; setup size of block
mov
block,a
mov
a,offset adres1
; Accumulator loaded with first RAM address
mov
mp,a
; setup memory pointer with first RAM address
loop:
clr
IAR
; clear the data at address defined by MP
inc
mp
; increment memory pointer
sdz
block
; check if last memory location has been cleared
jmp
loop
continue:
The important point to note here is that in the example shown above, no reference is made to specific RAM addresses.
0 0 H
0 1 H
0 2 H
0 3 H
0 4 H
0 5 H
0 6 H
0 7 H
0 8 H
0 9 H
0 A H
0 B H
0 C H
0 D H
0 E H
0 F H
1 0 H
1 1 H
1 2 H
1 3 H
1 4 H
1 5 H
1 6 H
1 7 H
1 8 H
1 9 H
1 A H
1 B H
1 C H
1 D H
1 E H
1 F H
2 0 H
2 1 H
2 2 H
2 3 H
: U n u s e d , r e a d a s " 0 0 "
I A R
M P
A C C
P C L
T B L P
T B L H
S T A T U S
I N T C
T M R
T M R C
P A
P A C
P B
P B C
P D
P D C
P W M
A D R
A D C R
A C S R
H T 4 6 R 4 6
I A R
M P
A C C
P C L
T B L P
T B L H
S T A T U S
I N T C
T M R
T M R C
P A
P A C
P B
P B C
P D
P D C
P W M
A D R L
A D R H
A D C R
A C S R
H T 4 6 R 4 7
I A R
M P
A C C
P C L
T B L P
T B L H
S T A T U S
I N T C
T M R
T M R C
P A
P A C
P B
P B C
P C
P C C
P D
P D C
P W M
A D R L
A D R H
A D C R
A C S R
H T 4 6 R 4 8 A
I A R
M P
A C C
P C L
T B L P
T B L H
S T A T U S
I N T C
T M R
T M R C
P A
P A C
P B
P B C
P C
P C C
P D
P D C
P W M 0
P W M 1
A D R L
A D R H
A D C R
A C S R
H T 4 6 R 4 9
Special Purpose Data Memory