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 is made to spe-
cific RAM addresses.
Bank Pointer
-
BP
The Bank Pointer only exists in the HT46R24/HT46C24 devices. The existence of the Bank
Pointer enables the HT46R24/HT46C24 devices to have a higher capacity of General Purpose
Data Memory compared to other devices in the A/D series. The address of the General Purpose
Data Memory bank in the HT46R24/HT46C24 microcontrollers ranges from 40H to FFH, a range
that would normally provide only 192 bytes of General Purpose Data Memory. However by locat-
ing the memory into two banks, known as Bank 0 and Bank 1, the General Purpose Data Memory
capacity can be expanded to 384 bytes. Bit 0 of the Bank Pointer, is utilized to set the present bank
of the General Purpose Data Memory. The General Purpose Data Memory is initialized to bank 0
after reset, except for the WDT Time-out reset in the HALT Mode, in which case, the General Pur-
pose Data Memory bank remains unchanged. When it is required to read from or write to the Gen-
eral Purpose Data Memory in the HT46R24/HT46C24 microcontrollers, it is necessary to first
setup the bank pointer to ensure that the correct memory bank is selected. It should be noted that
the Special Function Data Memory is not affected by the bank selection, which means 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 microcontroller and is closely related with opera-
tions carried out by the ALU. The Accumulator is the place where all intermediate results 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 programming and timing overheads. Data transfer operations usually involve the tempo-
rary storage function of the Accumulator; for example, when transferring data between one user
defined register and another, it is necessary to do this by passing the data through the Accumula-
tor as no direct transfer between two registers is permitted.
Program Counter Low Register
-
PCL
To provide additional program control functions, the low byte of the Program Counter is made ac-
cessible to programmers by locating it within the Special Purpose area of the Data Memory. By ma-
nipulating this register, direct jumps to other program locations are easily implemented. Loading a
value directly into this PCL register will cause a jump to the specified Program Memory location,
however as the register is only 8-bit wide, only jumps within the current Program Memory page are
permitted. When such operations are used, note that a dummy cycle will be inserted.
26
A/D Type MCU
Summary of Contents for HT46R22
Page 7: ...vi A D Type MCU...
Page 9: ...viii A D Type MCU...
Page 10: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Page 11: ...2 A D Type MCU...
Page 90: ...P a r t I I Programming Language Part II Programming Language 81...
Page 91: ...82 A D Type MCU...
Page 97: ...88 A D Type MCU...
Page 128: ...P a r t I I I Development Tools Part III Development Tools 119...
Page 129: ...120 A D Type MCU...
Page 140: ...Appendix Appendix 131...
Page 141: ...132 A D Type MCU...
Page 151: ...142 A D Type MCU...
Page 152: ...A p p e n d i x B Package Information Appendix B Package Information 143 B...
Page 161: ...A D Type MCU...
Page 162: ...Amendments...