Special Function Register Description; Indirect Addressing Registers - Iar0, Iar1, Iar2; Memory Pointers - Mp0, Mp1L/Mp1H, Mp2L/Mp2H - Holtek BS86DH12C Manual

High voltage touch a/d flash mcu with hvio
Table of Contents

Advertisement

Special Function Register Description

Most of the Special Function Register details will be described in the relevant functional sections.
However, several registers require a separate description in this section.
Indirect Addressing Registers – IAR0, IAR1, IAR2
The Indirect Addressing Registers, IAR0, IAR1 and IAR2, although having their locations in normal
RAM register space, do not actually physically exist as normal registers. The method of indirect
addressing for RAM data manipulation uses these Indirect Addressing Registers and Memory
Pointers, in contrast to direct memory addressing, where the actual memory address is specified.
Actions on the IAR0, IAR1 and IAR2 registers will result in no actual read or write operation to
these registers but rather to the memory location specified by their corresponding Memory Pointers,
MP0, MP1L/MP1H or MP2L/MP2H. Acting as a pair, IAR0 and MP0 can together access data only
from Sector 0 while the IAR1 register together with the MP1L/MP1H register pair and IAR2 register
together with the MP2L/MP2H register pair can access data from any Data Memory Sector. As
the Indirect Addressing Registers are not physically implemented, reading the Indirect Addressing
Registers will return a result of "00H" and writing to the registers will result in no operation.
Memory Pointers – MP0, MP1L/MP1H, MP2L/MP2H
Five Memory Pointers, known as MP0, MP1L, MP1H, MP2L, MP2H, 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 Sector 0, while MP1L/MP1H
together with IAR1 and MP2L/MP2H together with IAR2 are used to access data from all sectors
according to the corresponding MP1H or MP2H register. Direct Addressing can be used in all
sectors using the extended instruction which can address all available Data Memory space.
The following example shows how to clear a section of four Data Memory locations already defined
as locations adres1 to adres4.
Indirect Addressing Program Example 1
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:
Rev. 1.00
High Voltage Touch A/D Flash MCU with HVIO
; set size of block
; Accumulator loaded with first RAM address
; set memory pointer with first RAM address
; clear the data at address defined by MP0
; increase memory pointer
; check if last memory location has been cleared
34
BS86DH12C
October 26, 2018

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BS86DH12C and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents