资源描述:
《串行口版数字时钟》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、ORG0000HSJMPMAINMAIN:MOVSCON,#0MOV50H,#0MOV51H,#05MOV52H,#10MOV53H,#9MOV54H,#5MOV55H,#10MOV56H,#0MOV57H,#0MOV58H,#23MOVR0,#50HMOVR1,#8;;;;;;;;;;LOOP:MOVA,58HMOVB,#0AHDIVABMOV57H,AMOV56H,B;;;;;;;;;MOVDPTR,#TABLELOOP0:;;;;;;;;;MOVA,@R0MOVCA,@A+DPTRMOVSBUF,AJNBTI,$CLRTIINCR0DJNZR1,LOOP
2、0;;;;;;;;MOVR0,#50HMOVR1,#8;;;;;;;;;;;;;;LCALLDELAY_1S;;;;;;;;;;;;;INC50HMOVA,50HCJNEA,#10,LOOPMOV50H,#0INC51HMOVA,51HCJNEA,#6,LOOPMOV51H,#0INC53HMOVA,53HCJNEA,#10,LOOPMOV53H,#0INC54HMOVA,54HCJNEA,#6,LOOP1MOV54H,#0INC58HMOVA,58HCJNEA,#24,LOOP1MOV58H,#0LOOP1:AJMPLOOP;;;;;;;;;DELAY_1S
3、:MOVR5,#08HD_1:MOVR6,#0F4HD_2:MOVR4,0FFHDJNZR4,$DJNZR6,D_2DJNZR5,D_1RET;;;;;;;;;;;TABLE:DB0C0H,0F9H,0A4H,0B0H;0、1、2、3DB99H,92H,82H,0F8H;4、5、6、7DB80H,90H,0BFH,0FFH;8、9;;;;;;;;;;;;;;;;;;;;;;END