您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 述职报告 > 6位7段数码管时钟显示汇编程序
ORG0000HAJMPMAINORG000BHAJMPIT0PORG0040HMAIN:;主程序MOVP0,#0FFH;数码管初始状态都是8MOVP1,#0FFH;选中所有的数码管MOVSP,#60HMOVTMOD,#01HMOVIE,#82HMOV30H,#14H;存放定时循环次数单元20次MOV40H,#00H;存放时的数据单元MOV41H,#00H;存放分的数据单元MOV42H,#00H;存放秒的数据单元MOVTH0,#3CHMOVTL0,#0B0H;定时50ms*20SETBTR0LOOP:ACALLDISPLAY;调用显示子程序AJMPLOOPDISPLAY:;数码管显示子程序SECONDGE:SETBP1.0MOVA,42HANLA,#0FHACALLSEGACALLDELAY1MSCLRP1.0SECONDSHI:SETBP1.1MOVA,42HSWAPAANLA,#0FHACALLSEGACALLDELAY1MSCLRP1.1MINUTEGE:SETBP1.2MOVA,41HANLA,#0FHACALLSEGACALLDELAY1MSCLRP1.2MINUTESHI:SETBP1.3MOVA,41HSWAPAANLA,#0FHACALLSEGACALLDELAY1MSCLRP1.3HOURGE:SETBP1.4MOVA,40HANLA,#0FHACALLSEGACALLDELAY1MSCLRP1.4HOURSHI:SETBP1.5MOVA,40HSWAPAANLA,#0FHACALLSEGACALLDELAY1MSCLRP1.5RETIT0P:;中断服务子程序PUSHPSWPUSHAccCLRTR0MOVTH0,#3CHMOVTL0,#0B0HDJNZ30H,RETURNMOV30H,#14HMOVA,#01HADDA,42HDAAMOV42H,ACJNEA,#60H,RETURNMOV42H,#00HMOVA,#01HADDA,41HDAAMOV41H,ACJNEA,#60H,RETURNMOV41H,#00HMOVA,#01HADDA,40HDAAMOV40H,ACJNEA,#24H,RETURNMOV40H,#00HRETURN:SETBTR0POPAccPOPPSWRETISEG:MOVDPTR,#TAB;查表程序MOVCA,@A+DPTRCPLAMOVP0,ARETTAB:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FHDELAY1MS:MOVR7,#04H;延时程序D1:MOVR6,#7DHDJNZR6,$DJNZR7,D1RETEND
本文标题:6位7段数码管时钟显示汇编程序
链接地址:https://www.777doc.com/doc-2603904 .html