
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
Содержание HT48R05A-1
Страница 7: ...vi Cost Effective I O Type MCU...
Страница 8: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Страница 9: ...2 Cost Effective I O Type MCU...
Страница 52: ...P a r t I I Programming Language Part II Programming Language 45...
Страница 53: ...46 Cost Effective I O Type MCU...
Страница 59: ...52 Cost Effective I O Type MCU...
Страница 90: ...P a r t I I I Development Tools Part III Development Tools 83...
Страница 91: ...84 Cost Effective I O Type MCU...
Страница 101: ...94 Cost Effective I O Type MCU...
Страница 104: ...Appendix Appendix 97...
Страница 105: ...98 Cost Effective I O Type MCU...
Страница 115: ...108 Cost Effective I O Type MCU...
Страница 116: ...A p p e n d i x B Package Information Appendix B Package Information 109 B...
Страница 123: ...116 Cost Effective I O Type MCU...
Страница 125: ...Amendments...