ORG 0000HAJMP MAINORG 000BHAJMP INTT0ORG 0030HMAIN:MOV TMOD,#01HMOV TH0,#3CHMOV TL0,#0B0HMOV DPTR,#TABSETB EASETB ET0SETB TR0L2: MOV R7,#00HL1: MOV A,#0MOV B,#10DIV ABSETB P2.2SETB P2.1SETB P2.0MOVC A,@A+DPTRMOV P0,A CLR P2.3 SETB P2.3MOV A,BMOVC A,@A+DPTRMOV P0,A CLR P2.2 SETB P2.2MOV A,#10MOV B,#10DIV ABMOVC A,@A+DPTRMOV P0,A CLR P2.1 SETB P2.1MOV A,BMOVC A,@A+DPTRMOV P0,A CLR P2.0 SETB P2.0CJNE R7,#14H,L1LOOP1:MOV R6,#20HMOV R2,#00HMOV R4,#09HLOOP:MOV R3,#59HERE:MOV A,R3MOV B,#10DIV ABSETB P2.2SETB P2.1SETB P2.0 MOVC A,@A+DPTRMOV P0,A CLR P2.3 SETB P2.3MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.2 SETB P2.2MOV A,R4MOV B,#10DIV ABMOVC A,@A+DPTRMOV P0,ACLR P2.1 SETB P2.1MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.0SETB P2.0KAIGUAN:JB P2.6,L4CLR TR0L6: MOV A,R3MOV B,#10DIV ABSETB P2.2SETB P2.1SETB P2.0 MOVC A,@A+DPTRMOV P0,A CLR P2.3 SETB P2.3MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.2 SETB P2.2MOV A,R4MOV B,#10DIV ABMOVC A,@A+DPTRMOV P0,ACLR P2.1 SETB P2.1MOV A,BMOVC A,@A+DPTRMOV P0,ACLR P2.0SETB P2.0 JB P2.7,L6SETB TR0AJMP L4L4:CJNE R2,#14H,HEREDJNZ R6,$ MOV R2,#00HDEC R3CJNE R3,#0FFH,HEREDEC R4CJNE R4,#0FFH,LOOPAJMP L2 INTT0:MOV TH0,#3CHMOV TL0,#0B0HINC R2INC R7RETITAB:DB 040H,079H,24H,030H,019H,12H,02H,78H,00H,10HEND
单片机10分钟(带暂停)倒计时程序
ORG0000HAJMPMAINORG000BHAJMPINTT0ORG0030HMAIN:MOVTMOD,01HMOVTH0,
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/bandaoti/317881.html