参数资料
型号: SN8P1603S
厂商: SONIX Technology Co., Ltd.
英文描述: 8-Bit Micro-Controller
中文描述: 8位微控制器
文件页数: 19/94页
文件大小: 540K
代理商: SN8P1603S
SN8P1600
8-bit micro-controller
SONiX TECHNOLOGY CO., LTD
Page 19
Revision 1.94
CHECKSUM CALCULATION
The ROM addresses 0004H~0007H and last address are reserved area. User should avoid these addresses
(0004H~0007H and last address) when calculate the Checksum value.
Example:
The demo program shows how to avoid 0004H~0007H when calculated Checksum from 00H to the end of
user’s code
MOV
A,#END_USER_CODE$L
B0MOV
END_ADDR1,A
MOV
A,#END_USER_CODE$
M
B0MOV
END_ADDR2,A
CLR
Y
CLR
Z
@@:
CALL
YZ_CHECK
MOVC
B0BSET
FC
ADD
DATA1,A
MOV
A,R
ADC
DATA2,A
JMP
END_CHECK
AAA:
INCMS
Z
JMP
@B
JMP
Y_ADD_1
END_CHECK:
MOV
A,END_ADDR1
CMPRS
A,Z
JMP
AAA
MOV
A,END_ADDR2
CMPRS
A,Y
JMP
AAA
JMP
CHECKSUM_END
YZ_CHECK:
MOV
A,#04H
CMPRS
A,Z
RET
MOV
A,#00H
CMPRS
A,Y
RET
INCMS
Z
INCMS
Z
INCMS
Z
INCMS
Z
RET
Y_ADD_1:
INCMS
Y
NOP
JMP
@B
CHECKSUM_END:
……….
……….
END_USER_CODE:
;save low end address to end_addr1
;save middle end address to end_addr2
;set Y to ooH
;set Z to 00H
;call function of check yz value
;
;clear C glag
;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.
;check if YZ=0004H
;check if Z=04H
;if Not return to checksum calculate
;if Yes, check if Y=00H
;if Not return to checksum calculate
;if Yes, increase 4 to Z
;set YZ=0008H then return
;increase Y
;jump to checksum calculate
;Label of program end
相关PDF资料
PDF描述
SN8P1603X 8-Bit Micro-Controller
SN8P1604 8-Bit Micro-Controller
SN8P1604AK 8-Bit Micro-Controller
SN8P1604AP 8-Bit Micro-Controller
SN8P1604AQ 8-Bit Micro-Controller
相关代理商/技术参数
参数描述
SN8P1603X 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1604 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1604AK 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1604AP 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1604AQ 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller