English
Language : 

HT56R67_10 Datasheet, PDF (21/104 Pages) Holtek Semiconductor Inc – TinyPowerTM A/D Type with LCD 8-Bit MCU
HT56R67/HT56R668/HT56C668/HT56R678/HT56C678/HT56R688
function registers and the point where the General Pur-
pose Memory begins is reserved for future expansion
purposes, attempting to read data from these locations
will return a value of 00H.
Indirect Addressing Registers - IAR0, IAR1
The Indirect Addressing Registers, IAR0 and IAR1, al-
though having their locations in normal RAM register
space, do not actually physically exist as normal regis-
ters. The method of indirect addressing for RAM data
manipulation uses these Indirect Addressing Registers
and Memory Pointers, in contrast to direct memory ad-
dressing, where the actual memory address is speci-
fied. Actions on the IAR0 and IAR1 registers will result in
no actual read or write operation to these registers but
rather to the memory location specified by their corre-
sponding Memory Pointers, MP0 or MP1. Acting as a
pair, IAR0 and MP0 can together access data from Bank
0 while the IAR1 and MP1 register pair can access data
from any bank. As the Indirect Addressing Registers are
not physically implemented, reading the Indirect Ad-
dressing Registers indirectly will return a result of ²00H²
and writing to the registers indirectly will result in no op-
eration.
Memory Pointers - MP0, MP1
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. MP0, together with Indirect
Addressing Register, IAR0, are used to access data
from Bank 0, while MP1 and IAR1 are used to access
data from all banks.
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
mov block,a
mov a,offset adres1
mov mp0,a
loop:
clr IAR0
inc mp0
sdz block
jmp loop
continue:
; setup size of block
; Accumulator loaded with first RAM address
; setup memory pointer with first RAM address
; clear the data at address defined by MP0
; increment memory pointer
; check if last memory location has been cleared
The important point to note here is that in the example shown above, no reference is made to specific RAM addresses.
Rev. 1.20
21
March 4, 2010