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

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

Número de pieza
componentes Descripción
Fabricante
SN8P26042AKG
SONiX
Sonix Technology Co., Ltd SONiX
SN8P26042AKG Datasheet PDF : 101 Pages
First Prev 21 22 23 24 25 26 27 28 29 30 Next Last
SN8P2604A
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 21
Version 0.3

Share Link: 

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