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pointers, known as MP0 and MP1 are provided. These Memory Pointers are physically im-
plemented in the Data Memory and can be manipulated in the same way as normal registers providing a convenient way
with which to address and track data. When any operation to the relevant Indirect Addressing Registers is carried out, the
actual address that the microcontroller is directed to, is the address specified by the related Memory Pointer. For the
HT46R01 and HT46R02 devices, 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 ex-
ample shows how to clear a section of four Data Memory locations already defined as locations adres1 to adres4.
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 mp,a
; setup memory pointer with first RAM address
loop:
clr IAR
inc mp
sdz block
jmp loop
; clear the data at address defined by MP
; 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.00
12
September 21, 2007