EasyManua.ls Logo

Holtek HT48R05A-1 - Special Function Registers; Indirect Addressing Register - IAR; Memory Pointer - MP

Default Icon
125 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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, Watchdog, etc., as well as external functions such as I/O data control. The loca
-
tion 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 ²00H², is not physically implemented. This spe
-
cial register allows what is known as indirect addressing, which permits data manipulation using
Memory Pointers instead of the usual direct memory addressing method where the actual mem
-
ory address is defined. Any actions on the IAR register will result in corresponding read/write oper
-
ations to the memory location specified 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 implemented in Data Memory. The Memory
Pointer can be written to and manipulated in the same way as normal registers providing an easy
way of addressing and tracking data. When using any operation on the indirect addressing regis
-
ter IAR, it is actually the address specified by the Memory Pointer that the microcontroller will be di
-
rected to.
Note
The bit 7 of the Memory Pointer is not implemented. However, it must be noted that when the
Memory Pointer in these devices is read, a value of ²1² will be read.
The following example shows how to clear a section of four RAM locations already defined as loca-
tions 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 ; setup size of block
mov block,a
mov a,offset adres1 ; Accumulator loaded with first RAM address
mov mp,a ; setup Memory Pointer with first RAM address
loop:
clr IAR ; clear the data at address defined by MP
inc mp ; increment Memory Pointer
sdz block ; check if last memory location has been cleared
jmp loop
continue:
The important point to note here is that in the example shown above, no reference made to spe
-
cific RAM addresses.
Chapter 1 Hardware Structure
19

Table of Contents