English
Language : 

HT86B03 Datasheet, PDF (32/83 Pages) Holtek Semiconductor Inc – Enhanced Voice 8-Bit MCU
HT86BXX/HT86BRXX
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
; setup size of block
; Accumulator loaded with first RAM address
; setup memory pointer with first RAM address
loop:
clr IAR0
inc mp0
sdz block
jmp loop
; clear the data at address defined by MP0
; increment memory pointer
; check if last memory location has been cleared
continue:
The important point to note here is that in the example shown above, no reference is made to specific RAM addresses.
Bank Pointer - BP
The RAM Data Memory is divided into two Banks,
known as Bank 0 and Bank 1. With the exception of the
BP register, all of the Special Purpose Registers and
General Purpose Registers are contained in Bank 0. If
data in Bank 0 is to be accessed, then the BP register
must be loaded with the value "00", while if data in Bank
1 is to be accessed, then the BP register must be loaded
with the value ²01².
Using Memory Pointer MP0 and Indirect Addressing
Register IAR0 will always access data from Bank 0, irre-
spective of the value of the Bank Pointer.
The Data Memory is initialised to Bank 0 after a reset,
except for the WDT time-out reset in the Power Down
Mode, in which case, the Data Memory bank remains
unaffected. It should be noted that Special Function
Data Memory is not affected by the bank selection,
which means that the Special Function Registers can be
accessed from within either Bank 0 or Bank 1. Directly
addressing the Data Memory will always result in Bank 0
being accessed irrespective of the value of the Bank
Pointer.
as addition, subtraction, shift, etc., to the Data Memory
resulting in higher programming and timing overheads.
Data transfer operations usually involve the temporary
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 Accumulator 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 accessible to pro-
grammers by locating it within the Special Purpose area
of the Data Memory. By manipulating this register, direct
jumps to other program locations are easily imple-
mented. Loading a value directly into this PCL register
will cause a jump to the specified Program Memory lo-
cation, however, as the register is only 8-bit wide, only
jumps within the current Program Memory page are per-
mitted. When such operations are used, note that a
dummy cycle will be inserted.
Look-up Table Registers - TBLP, TBLH
Accumulator - ACC
The Accumulator is central to the operation of any
microcontroller and is closely related with operations
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 calculation or logical operation such
These two special function registers are used to control
operation of the look-up table which is stored in the Pro-
gram Memory. TBLP is the table pointer and indicates
the location where the table data is located. Its value
must be setup before any table read commands are ex-
ecuted. Its value can be changed, for example using the
²INC² or ²DEC² instructions, allowing for easy table data
pointing and reading. TBLH is the location where the
b7
b0
B P 0 B a n k P o in te r
B P 0 D a ta M e m o ry
0 B ank 0
1 B ank 1
N o t u s e d , m u s t b e re s e t to "0 "
Bank Pointer - BP
Rev. 1.70
32
February 22, 2010