资源描述:
《4×4矩阵键盘51汇编程序(线反转法)》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、矩阵键盘线反转法ISIS仿真图汇编源程序代码ORG0000HLJMPMAINORG0100HMAIN:ACALLKEYSCAN;调用子函数MOVA,30H;从30H单元取相应的数值MOVDPTR,#TABLEMOVCA,@A+DPTRMOVP2,AACALLDELAYSJMPMAINKEYSCAN:MOVP3,#0FH;线反转法MOVA,P3ANLA,#0FHMOVB,AMOVP3,#0F0HMOVA,P3ANLA,#0F0HORLA,BCJNEA,#0FFH,KEYPRORETKEYPRO:MOVB,A;键值处理程序MOVDPTR,#KEYV
2、ALUEMOVR3,#0FFHKEY1:INCR3MOVA,R3MOVCA,@A+DPTRCJNEA,B,KEY2MOVA,R3MOV30H,ARETKEY2:CJNEA,#00H,KEY1;扫描键值结束标志RETDELAY:MOVR0,#20;延时程序NEXT1:MOVR1,#20NEXT2:MOVR2,#248DJNZR2,$DJNZR1,NEXT2DJNZR0,NEXT1RETKEYVALUE:DB77H,7BH,7DH,7EH;键值DB0B7H,0BBH,0BDH,0BEHDB0D7H,0DBH,0DDH,0DEHDB0E7H,0EBH
3、,0EDH,0EEHDB00HTABLE:DB0C0H,0F9H,0A4H,0B0H;共阳数码管编码值DB99H,92H,82H,0F8HDB80H,90H,88H,83HDB0C6H,0A1H,86H,8EHEND