English
Language : 

HT49RA1 Datasheet, PDF (13/58 Pages) Holtek Semiconductor Inc – Remote Type 8-Bit MCU with LCD
HT49RA1/HT49CA1
Memory Pointers - MP0, MP1
Two Memory Pointers, known as MP0 and MP1 are provided. These Memory Pointers are physically implemented 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. MP0, together
with Indirect Addressing Register, IAR0, are used to access data from Bank0, while MP1 and IAR1 are used to access
data from Bank0 and Bank1.
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
mov
mov
mov
a,04h
block,a
a,offset adres1
mp0,a
; setup size of block
; Accumulator loaded with first RAM address
; setup memory pointer with first RAM address
loop:
clr
inc
sdz
jmp
IAR0
mp0
block
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 RAM addresses.
Bank Pointer - BP
In the Data Memory area it should be noted that both the
LCD Memory and the other Data Memory share the
same addresses. Therefore when using instructions to
access the LCD Memory or the General Purpose Data
Memory, it is necessary to ensure that the correct area is
selected. The General Purpose is located in Bank 0
while the LCD Memory is located in Bank 1. Selecting
the correct Data Memory area is achieved by using the
Bank Pointer. If data in Bank 0 is to be accessed then BP
should be cleared to zero, while if the LCD Memory is to
be accessed, which is located in Bank 1, then BP should
be loaded with a value of 01H. It must be noted that data
in Bank 1can only be accessed indirectly using the MP1
Memory Pointer and the IAR1 indirect addressing regis-
ter. Any direct addressing or any indirect addressing us-
ing MP0 and IAR0 will always result in data from Bank 0
being accessed. The Data Memory Bank Pointer is in-
itialised to Bank 0 after a reset, except for the WDT
time-out reset in the Power Down Mode, in which case,
the Data Memory Bank Pointer remains unchanged. It
should be noted that the Special Function Data Memory
is not affected by the bank selection, which means that
the Special Function Registers can be accessed from
within either Bank 0 or Bank 1.
Accumulator - ACC
The Accumulator is central to the operation of any and
is closely related with operations carried out by the ALU.
The Accumulator is the place where all intermediate re-
sults from the ALU are stored. Without the Accumulator
it would be necessary to write the result of each calcula-
tion or logical operation such as addition, subtraction,
shift, etc., to the Data Memory resulting in higher pro-
gramming and timing overheads. Data transfer opera-
tions usually involve the temporary storage function of
the Accumulator; for example, when transferring data
between one user defined register and another, it is nec-
essary to do this by passing the data through the Accu-
mulator as no direct transfer between two registers is
permitted.
b7
b0
B P 0 B P R e g is te r
B P 0 D a ta M e m o ry
0 B ank 0
1 B a n k 1 L C D M e m o ry
N o t u s e d , m u s t b e re s e t to "0 "
Bank Pointer Register
Rev. 1.00
13
May 7, 2008