HT37B90/HT37B70/HT37B50/HT37B30
Example
The following example shows how to clear General Purpose Data Memory of bank0 by using MP0 and bank0~bank1
by using MP1 and MP2
code .section at 0 code
org 00h
RAM0TEST:
MOV A,60H
MOV MP0,A
LOOP0:
; loaded with first RAM address
CLR IAR0
CLR WDT
; clear the data at address defined by MP0
SIZ MP0
JMP LOOP0
:
; increase MP0, and skip out if MP0 is ²0²
RAM1TEST:
CLR DACC.7
CLR rBP1
; access data to iar1 by MP1
; clear RAM bank pointer 1
RAM1_MP1:
MOV A,rBP1
XOR A,25
; load rBP1 data, and check if rBP1 is ²25²
SZ
ZERO
; jump to exit loop if rBP1 is ²2²
JMP RAM1TEST_Exit
MOV A,60H
MOV MP1,A
; loaded with first RAM address to MP1
LOOP1:
CLR WDT
CLR IAR1
; clear the data at address defined by MP1
SIZ MP1
JMP LOOP1
INC rBP1
; increase MP1, and skip out if MP1 is ²0²
; increase rBP1
JMP RAM1_MP1
RAM1TEST_Exit:
:
RAM2TEST:
Set dacc.7
CLR rBP2
; access data to iar1 by MP2
; clear RAM bank pointer 2
RAM1MP2:
MOV A,RBP2
XOR A,25
SZ
ZERO
; jump to exit loop if rBP2 is ²2²
JMP RAM2TEST_Exit
MOV A,60H
MOV MP2,A
; loaded with first RAM address to MP2
LOOP2:
CLR WDT
CLR IAR1
; clear the data at address defined by MP2
SIZ MP2
JMP LOOP2
INC rBP2
JMP RAM1MP2
RAM2TEST_Exit:
:
; increase MP2, and skip out if MP2 is ²0²
; increase rBP2
Rev. 1.00
17
June 22, 2017