资源描述:
《单片机各种实验程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、数字秒表ORG0000HLJMPSTARTORG0003HLJMPPINT0ORG001BHLJMPTIM1START:MOVTMOD,#10HMOVTH1,#4CHMOVTL1,#00HMOVSCON,#00HSETBTR1SETBET1SETBIT0SETBEX0SETBEAMOVR3,#20MOVR4,#00HDIS:LCALLDISPSJMPDISTAB:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FHTIM1:PUSHACCDJNZR3,QUITMOVR3,#20MOVA,R4ADDA,#01HD
2、AAMOVR4,ACJNER4,#31H,N31CLRAMOVR4,AQUIT:POPACCRETIPINT0:CPLTR1RETIDISP:MOVA,R4ANLA,#0FHMOVDPTR,#TABMOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTISETBP1.0CLRP1.1LCALLDELYMOVA,R4SWAPAANLA,#0FHMOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTICLRP1.0SETBP1.1LCALLDELYRETDELY:MOVR0,#20Y1:MOVR1,#80Y2:MOVR2
3、,#10DJNZR2,$DJNZR1,y2DJNZR0,Y1RETEND数字钟ORG0000HLJMPSTARTORG001BHLJMPPINT1START:MOVTMOD,#10HMOVTH1,#3CHMOVTL1,#0B0HSETBTR1SETBET1SETBIT0SETBEX0SETBEAMOVSCON,#00HMOVR0,#1;修改时间MOVR1,#00HMOVR2,#0FEHMOVR4,#00HMOVR5,#00HDIS:LCALLDISPSJMPDISTAB:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7
4、FH,6FHPINT1:MOVTH1,#3CHMOVTL1,#0B0HPUSHACCDJNZR0,LP0MOVR0,#1;修改时间MOVA,R1INCAMOVR1,A;CJNEA,#3CH,LP0;MOVR1,#00H;MOVR1,AINCR6LP0:POPACCRETIDISP:MOVA,R1MOVB,#10DIVABMOVDPTR,#TABMOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTIMOVP1,#0FDHLCALLDL1MSMOVP1,#0FFHMOVA,BMOVCA,@A+DPTRMOVSBUF,AJNBTI,
5、$CLRTIMOVP1,#0FEHRLALCALLDL1MSMOVP1,#0FFHCJNER6,#3CH,LP1INCR4MOVR1,#00HMOVR6,#00HLP1:MOVA,R4MOVB,#10DIVABMOVDPTR,#TABMOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTIMOVP1,#0F7HLCALLDL1MSMOVP1,#0FFHMOVA,BMOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTIMOVP1,#0FBHRLALCALLDL1MSMOVP1,#0FFHCJNER4,#3CH,LP2
6、INCR5MOVR4,#00HLP2:MOVA,R5MOVB,#10DIVABMOVDPTR,#TABMOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTIMOVP1,#0DFHLCALLDL1MSMOVP1,#0FFHMOVA,BMOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTIMOVP1,#0EFHLCALLDL1MSMOVP1,#0FFHCJNER5,#24H,LP3MOVR5,#00HLP3:RETDL1MS:MOVR7,#1;延迟1MSDJNZR7,$RETEND串口显示0~9ORG0000HLJM
7、PSTARTSTART:MOVA,#01HMOVSCON,#00HMOVR5,#00HMOVDPTR,#TABLOOP:MOVP1,ALCALLD1SRLAPUSHACCMOVA,R5MOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTIINCR5CJNER5,#10,LP1MOVR5,#0LP1:POPACCSJMPLOOPD1S:MOVR1,#20L1:MOVR2,#200L2:MOVR3,#126DJNZR3,$DJNZR2,L2DJNZR1,L1RETTAB:DB3FH,06H,5BH,4FH,66H,6DH,7DH,
8、07H,7FH,6FH,40HEND数字秒表org0000hljmpmainorg0003hljmpzdx0org001bhljmpyst1org0023hljmpcxkmain