您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 其它办公文档 > 广工自动化单片机课程设计
自动化学院网络工程专业班学号姓名1.程序一:在显示器上显示任意四位十六进制数:56AFORG0000HLJMPMAINORG1000HMAIN:MOV52H,#02HMOV53H,#03HMOV51H,#01HMOV50H,#00HMOVR5,#53HKEYSUB:MOVA,#0DHMOVDPTR,#7F00HMOVX@DPTR,ABEGIN:ACALLDISAJMPBEGINDIS:PUSHACCPUSH00HPUSH03HMOVR0,#50HMOVR3,#7FHMOVA,R3AGAIN:MOVDPTR,#7F03HMOVX@DPTR,AMOVA,@R0MOVDPTR,#DDEGMOVA,@A+DPTRMOVDPTR,#7F01HMOVX@DPTR,AACALLDLIMSINCR0MOVA,R3JNBACC.3,OUTRRAMOVR3,AAJMPAGAINOUT:POP03HPOP00HPOPACCRETDDEG:DB79H,7CH,07H,5BH,6FH,7FH,77H,39HA1:MOVA,R3MOVDPTR,#7F01HMOVX@DPTR,AMOVDPTR,#1000HMOVA,R2MOVCA,@A+DPTRMOVDPTR,#7F02HMOVX@DPTR,ACALLDLIMSINCR2MOVA,R3RLAMOVR3,AJNBACC.4,BEGINJMPA1DLIMS:MOVR7,#05HDL0:MOVR6,#0FFHDL1:DJNZR6,DL1DJNZR7,DL0RETEND2.程序二:将8个键按实验室要求定义键值,按任意键在显示器上显示对应键值,要求显示值能左移;98ACEB72ORG0000HLJMPMAINORG1000HMAIN:MOV52H,#00HMOV53H,#00HMOV51H,#00HMOV50H,#00HMOVR5,#53HKEYSUB:MOVA,#0DHMOVDPTR,#7F00HMOVX@DPTR,ABEGIN:ACALLDISACALLCLEARACALLCCSCANJNZINK1AJMPBEGININK1:ACALLDISACALLDLIMSACALLDLIMSACALLCLEARACALLCCSCANJNZINK2AJMPBEGININK2:MOVR2,#07fHMOVR4,#00HCOLUM:MOVDPTR,#7F03HMOVA,R2MOVX@DPTR,AINCDPTRINCDPTRMOVXA,@DPTRJBACC.2,LONEMOVA,#00HAJMPKCODELONE:JBACC.6,NEXTMOVA,#04HKCODE:ADDA,R4CJNEA,#00H,XYGMOVA,#09HAJMPXYG7XYG:CJNEA,#01H,XYG1MOVA,#08HAJMPXYG7XYG1:CJNEA,#02H,XYG2MOVA,#0AHAJMPXYG7XYG2:CJNEA,#03H,XYG3MOVA,#0CHAJMPXYG7XYG3:CJNEA,#04H,XYG4MOVA,#0EHAJMPXYG7XYG4:CJNEA,#05H,XYG5MOVA,#0BHAJMPXYG7XYG5:CJNEA,#06H,XYG6MOVA,#07HAJMPXYG7XYG6:CJNEA,#07H,XYG7MOVA,#02HAJMPXYG7XYG7:ACALLPUTBUFPUSHACCKON:ACALLDISACALLCLEARACALLCCSCANJNZKONPOPACCNEXT:INCR4MOVA,R2JNBACC.3,KEERRRAMOVR2,AAJMPCOLUMKERR:AJMPBEGINCCSCAN:MOVDPTR,#7F03HMOVA,#00HMOV@DPTR,AINCDPTRINCDPTRMOVXA,@DPTRCPLAANLA,#44HRETCLEAR:MOVDPTR,#7F03HMOVA,#00HMOVX@DPTR,ARETDIS:PUSHACCPUSH00HPUSH03HMOVR0,#50HMOVR3,#0F7HMOVA,R3AGAIN:MOVDPTR,#7F03HMOVX@DPTR,AMOVA,@R0MOVDPTR,#DDEGMOVCA,@A+DPTRMOVDPTR,#7F01HMOVX@DPTR,AACALLDLIMSINCR0MOVA,R3JNBACC.0,OUTRLAMOVR3,AAJMPAGAINOUT:POP03HPOP00HPOPACCRETDDEG:DB0FCH,60H,0DAH,0F2HDB66H,0B6H,0BEH,0E0HDB0FEH,0F6H,0EEH,3EHDB9CH,7AH,9EH,8EHDLIMS:MOVR7,#01HDL0:MOVR6,#0FFHDL1:DJNZR6,DL1DJNZR7,DL0RETPUTBUF:PUSH00HPUSHACCMOV53H,52HMOV52H,51HMOV51H,50HPOPACCMOV50H,AGOBACK:POP00HRETEND2.程序三:程序实现以下要求a)定义键盘按键b)可进行三位16进制除法运算c)可进行两位10进制乘法运算ORG0000HLJMPMAINORG1000HMAIN:MOV53H,#00HMOV52H,#00HMOV51H,#00HMOV50H,#00HMOV60H,#00HMOV61H,#00HMOV62H,#00HMOV63H,#00HMOV64H,#00HMOV65H,#00HMOV66H,#00HMOV67H,#00HMOV68H,#0CCHKEYSUB:MOVA,#0DHMOVDPTR,#7F00HMOVX@DPTR,ABEGIN:ACALLDISACALLCLEARACALLCCSCANJNZINK1AJMPBEGININK1:ACALLDISACALLDLIMSACALLDLIMSACALLCLEARACALLCCSCANJNZINK2AJMPBEGININK2:MOVR2,#07fHMOVR4,#00HCOLUM:MOVDPTR,#7F03HMOVA,R2MOVX@DPTR,AINCDPTRINCDPTRMOVXA,@DPTRJBACC.2,LONEMOVA,#00HAJMPKCODELONE:JBACC.6,NEXTMOVA,#04HKCODE:ADDA,R4CJNEA,#00H,XYGMOVA,#09HAJMPXYG7XYG:CJNEA,#01H,XYG1MOVA,#08HAJMPXYG7XYG1:CJNEA,#02H,XYG2MOVA,#0AHAJMPXYG7XYG2:CJNEA,#03H,XYG3MOVA,#0CHAJMPXYG7XYG3:CJNEA,#04H,XYG4MOVA,#0EHAJMPXYG7XYG4:CJNEA,#05H,XYG5MOVA,#0BHAJMPXYG7XYG5:CJNEA,#06H,XYG6MOVA,#07HAJMPXYG7XYG6:CJNEA,#07H,XYG7MOVA,#02HAJMPXYG7XYG7:ACALLPUTBUFPUSHACCKON:ACALLDISACALLCLEARACALLCCSCANJNZKONPOPACCNEXT:INCR4MOVA,R2JNBACC.3,KEERRRAMOVR2,AAJMPCOLUMKERR:AJMPBEGINCCSCAN:MOVDPTR,#7F03HMOVA,#00HMOV@DPTR,AINCDPTRINCDPTRMOVXA,@DPTRCPLAANLA,#44HRETCLEAR:MOVDPTR,#7F03HMOVA,#00HMOVX@DPTR,ARETDIS:PUSHACCPUSH00HPUSH03HMOVR0,#50HMOVR3,#0F7HMOVA,R3AGAIN:MOVDPTR,#7F03HMOVX@DPTR,AMOVA,@R0MOVDPTR,#DDEGMOVCA,@A+DPTRMOVDPTR,#7F01HMOVX@DPTR,AACALLDLIMSINCR0MOVA,R3JNBACC.0,OUTRLAMOVR3,AAJMPAGAINOUT:POP03HPOP00HPOPACCRETDDEG:DB11H,12H,0CH,66HDB10H,09H,04H,08HSZDEG:DB0FCH,60H,0DAH,0F2HDB66H,0B6H,0BEH,0E0HDB0FEH,0F6H,0EEH,3EHDB9CH,7AH,9EH,8EHDB0CCH,0DDH,0EEHPUTBUF:PUSH00HPUSHACCMOVA,62HMOV63H,AMOVA,61HMOV62H,AMOVA,60HMOV61H,APOPACCPUSHDPHPUSHDPLMOVR5,AMOVDPTR,#DDEGMOVCA,@A+DPTRMOV60H,AMOVA,R5POPDPLPOPDPHGOBACK:POP00HJISUAN:CJNEA,#02H,CHUHAOACALLFUHAOAJMPJSENDCHUHAO:CJNEA,#01H,DENGYUHAOACALLFUHAOAJMPJSENDDENGYUHAO:CJNEA,#03H,SHUZIACALLDENGYUAJMPJSENDSHUZI:ACALLPUTBUFJSEND:RETFUHAO:PUSHACCPUSHDPHPUSHDPLMOVDPTR,#DDEGMOVCA,@A+DPTRMOVDPTR,#SEDEGMOVCA,@A+DPTRMOV68H,AMOVA,60HMOV64H,AMOVA,61HMOV65H,AMOVA,62HMOV66H,AMOVA,63HMOV67H,AMOV60H,#00HMOV61H,#00HMOV62H,#00HMOV63H,#00HPOPDPLPOPDPHPOPACCRETDENGYU:PUSHACCMOVA,61HANLA,#0FHRLARLARLARLAMOVR5,AMOVA,60HANLA,#0FHORLA,R5MOV50H,AMOVA,63HANLA,#0FHRLARLARLARLAMOVR5,AMOVA,62HANLA,#0FHORLA,R5MOV51H,AMOVA,65HANLA,#0FHRLARLARLARLAMOVR5,AMOVA,64HANLA,#0FHORLA,R5MOV52H,AMOVA,67HANLA,#0FHRLARLARLARLAMOVR5,AMOVA,66HANLA,#0FHORLA,R5MOV53H,AMOVA,68HCJNEA,#0DDH,CHENGFAAJMPJIWANCHENGFA:MOVA,50HANLA,#07HMOV69H,AMOVA,50HANLA,#10HRRAORL69H,AMOVA,50HANLA,#60HRRAMOV70H,AMOVA,51HANLA,#03HSWAPARLARLAORL70H,AMOVA,51HANLA,#04HRRARRAMOV71H,AMOVA,51HANLA,#70HRRARRARRAORL71H,AMOVA,#00HORLA,71HMOV51H,AMOVA,70HORLA,69HMOV50H,AMOVA,52HANLA,#07HMOV69H,AMOVA,52HANLA,#10HRRAORL69H,AMOVA,52HANLA,#60HRRAMOV70H,AMOVA,53HANLA,#03HSWAPARLARLAORL70H,AMOVA,53HANLA,#04HRRARRAMOV71H,AMOVA,53HANLA,#70HRRARRARRAORL71H,AMOVA,#00HORLA,71HMOV53H,AMOVA,70HORLA,69HMOV52H,ADBMUL:MOVA,52HMOVB,50HMULABXCHA,50HMOV74H,BMOVB,53HMULABADDA,74HMOV75H,ACLRAADDCA,BMOV74H,AMOVA,51HMOVB,52HMULABADDA,75HXC
本文标题:广工自动化单片机课程设计
链接地址:https://www.777doc.com/doc-17729 .html