DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

SN8P2606 Ver la hoja de datos (PDF) - Sonix Technology Co., Ltd

Número de pieza
componentes Descripción
Fabricante
SN8P2606
SONiX
Sonix Technology Co., Ltd SONiX
SN8P2606 Datasheet PDF : 112 Pages
First Prev 11 12 13 14 15 16 17 18 19 20 Next Last
SN8P2608
8-Bit Micro-Controller
2.1.1.5 CHECKSUM CALCULATION
The last ROM address are reserved area. User should avoid these addresses (last address) when calculate the
Checksum value.
¾ Example: The demo program shows how to calculated Checksum from 00H to the end of user’s code.
@@:
AAA:
END_CHECK:
MOV
B0MOV
MOV
B0MOV
CLR
CLR
MOVC
B0BSET
ADD
MOV
ADC
JMP
INCMS
JMP
JMP
MOV
CMPRS
JMP
MOV
CMPRS
JMP
JMP
A,#END_USER_CODE$L
END_ADDR1, A
; Save low end address to end_addr1
A,#END_USER_CODE$M
END_ADDR2, A
; Save middle end address to end_addr2
Y
; Set Y to 00H
Z
; Set Z to 00H
FC
DATA1, A
A, R
DATA2, A
END_CHECK
Z
@B
Y_ADD_1
A, END_ADDR1
A, Z
AAA
A, END_ADDR2
A, Y
AAA
CHECKSUM_END
; Clear C flag
; Add A to Data1
; Add R to Data2
; Check if the YZ address = the end of code
; Z=Z+1
; If Z != 00H calculate to next address
; If Z = 00H increase Y
; Check if Z = low end address
; If Not jump to checksum calculate
; If Yes, check if Y = middle end address
; If Not jump to checksum calculate
; If Yes checksum calculated is done.
Y_ADD_1:
INCMS Y
NOP
JMP
@B
CHECKSUM_END:
END_USER_CODE:
; Increase Y
; Jump to checksum calculate
; Label of program end
SONiX TECHNOLOGY CO., LTD
Page 20
Version 1.4

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]