Accumulator - Acc - Holtek BS86DH12C Manual

High voltage touch a/d flash mcu with hvio
Table of Contents

Advertisement

BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
Indirect Addressing Program Example 2
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, 01h
mov mp1h, a
mov a, offset adres1
mov mp1l, a
loop:
clr IAR1
inc mp1l
sdz block
jmp loop
continue:
The important point to note here is that in the example shown above, no reference is made to specific
Data Memory addresses.
Direct Addressing Program Example using extended instructions
data .section ´data´
temp db ?
code .section at 0 ´code´
org 00h
start:
lmov a, [m]
lsub a, [m+1]
snz c
jmp continue
lmov a, [m]
mov temp, a
lmov a, [m+1]
lmov [m], a
mov a, temp
lmov [m+1], a
continue:
Note: here "m" is a data memory address located in any data memory sectors. For example,
m=1F0H, it indicates address 0F0H in Sector 1.
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 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.
Rev. 1.00
; set size of block
; set the memory sector
; Accumulator loaded with first RAM address
; set memory pointer with first RAM address
; clear the data at address defined by MP1L
; increase memory pointer MP1L
; check if last memory location has been cleared
; move [m] data to acc
; compare [m] and [m+1] data
; [m]>[m+1]?
; no
; yes, exchange [m] and [m+1] data
35
October 26, 2018

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BS86DH12C and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents