HT46R4A Holtek Semiconductor, HT46R4A Datasheet - Page 11

no-image

HT46R4A

Manufacturer Part Number
HT46R4A
Description
Cost-Effective A/D Type 8-Bit MCU
Manufacturer
Holtek Semiconductor
Datasheet
www.datasheet4u.com
Special Function Registers
To ensure successful operation of the microcontroller,
certain internal registers are implemented in the Data
Memory area. These registers ensure correct operation
of internal functions such as timers, interrupts, etc., as
well as external functions such as I/O data control and
A/D converter operation. The location of these registers
within the Data Memory begins at the address 00H. Any
unused Data Memory locations between these special
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 Register - IAR
The IAR register, located at Data Memory address
ter allows what is known as indirect addressing, which
permits data manipulation using Memory Pointers in-
The following example shows how to clear a section of four RAM locations already defined as locations adres1 to
adres4.
data .section
adres1
adres2
adres3
adres4
block
code .section at 0 code
org
start:
loop:
continue:
The important point to note here is that in the example shown above, no reference is made to specific RAM addresses.
Rev. 1.00
00H , is not physically implemented. This special regis-
00h
data
mov a,04h
mov block,a
mov a,offset adres1 ; Accumulator loaded with first RAM address
mov mp,a
clr IAR
inc mp
sdz block
jmp loop
db ?
db ?
db ?
db ?
db ?
; setup size of block
; setup memory pointer with first RAM address
; clear the data at address defined by MP
; increment memory pointer
; check if last memory location has been cleared
11
stead of the usual direct memory addressing method
where the actual memory address is defined.
Any actions on the IAR register will result in correspond-
ing read/write operations to the memory location speci-
fied by the Memory Pointer MP. Reading the IAR
register indirectly will return a result of 00H and writing
to the register indirectly will result in no operation.
Memory Pointer - MP
One Memory Pointer, known as MP, is physically imple-
mented in the Data Memory. The Memory Pointer can
be written to and manipulated in the same way as nor-
mal registers providing an easy way of addressing and
tracking data. When using any operation on the indirect
addressing register IAR, it is actually the address speci-
fied by the Memory Pointer that the microcontroller will
be directed to.
November 28, 2007
HT46R4A

Related parts for HT46R4A