计算器---广工11自动化微机实验设计报告)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1微机课程设计任务书一、课程设计的内容1.在显示器上显示任意6位十六进制数2.将8个键按实验室要求定义键值,按任意键在显示器上显示对应键值,要求显示值能够左移。3.实现:A)定义键盘按键,8个为数字键0,1,2,3,4,5,6,7和3个功能键:减号-,乘号×,等号=;B)可进行五位8进制减法运算;C)可进行三位8进制乘法运算。二、课程设计的要求与数据(1)巩固和加深对《微机原理》课程内容的认识和理解,提高应用水平。(2)掌握汇编语言程序的编制方法。(3)熟悉键盘控制和七段数码管的使用三、课程设计应完成的工作完成线路的接线,编写三个程序并输入电脑中,把程序加载到W86学习机当中,运行程序验证结果。四、应收集的资料及主要参考文献1许立锌等编.微型计算机原理及应用.北京:机械工业出版社,20032.许立梓等编《微型计算机原理及应用》--习题解答、实验指导及课程设计.北京:机械工业出版社,2003发出任务书日期:2013年12月20日指导教师签名:计划完成日期:2013年12月24日基层教学单位责任人签章:主管院长签章:2课程设计1(1)实现:在显示器上显示6位十六进制数9A7B3C。(2)源程序:;--------------------------------------------------------------------STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTTABLEDB0FCH,60H,0DAH,0F2H,66H,0B6H,0BEH,0E0H,DB0FEH,0F6H,0EEH,3EH,9CH,7AH,9EH,8EHDATA1DB9,10,7,11,3,12DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDX,0606HMOVAL,80HOUTDX,ALA1:LEASI,DATA1MOVCX,0006HMOVAH,OFEHA2:MOVDX,0602HMOVAL,[DI]OUTDX,ALMOVDX,0604HMOVBX,OFFSETTABLEMOVAL,[SI]XLATTABLEOUTDX,ALCALLDALLYINCSIINCDILOOPL2JMPA1DALLY:PUSHCXMOVCX,0002HA3:MOVAX,00FFHA4:DECAX3JNZA4LOOPA3POPCXRETCODEENDSENDSTART;--------------------------------------------------------------------课程设计2(1)实现:将8个键按实验室要求定义键值,按任意键在显示器上显示对应键值,要求显示值能够左移。键值分布如下:AB6793EF(2)源程序:;--------------------------------------------------------------------STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTTABLDB0FCH,60H,0DAH,0F2H,66H,0B6H,0DEH,0E0H,DB0FEH,0F6H,0EEH,3EH,9CH,7AH,9EH,8EHVA1DB0DFH,0EFH,0F7H,0FBH,0FDH,0FEHVA2DB0FCH,0FCH,0FCH,0FCH,0FCH,0FCHVA3DB00H,00H,00H,00H,00H00H,00HDATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAL,90HMOVDX0606HOUTDX,ALMOVBX,0000HSTT:MOVAL,00HMOVDX,0602HOUTDX,ALMOVDX,0600HINAL,DXANDAL,3CH4CMPAL,3CHJNZKEYABCCALLDISP;调用显示程序JMPSTT;--------------------------------------------------------------------KEYABC:CALLTIME;延时,去抖动MOVDX,0600HINAL,DXANDAL,3CHCMPAL,3CHJNZKEYJMPSTTKEY:MOVDX,0602HMOVAL,0FEH;键盘扫描识别OUTDX,ALMOVDX,0600HINAL,DXTESTAL,04HJNZKEY_7CALLKEY0JMPSTTKKEY_7:TESTAL,08HJNZKEY_2CALLKEY4JMPSTTKKEY_2:MOVDX,0602HMOVAL,0FDHOUTDX,ALMOVDX,0600HINAL,DXTESTAL,04HJNZKEY_6CALLKEY1JMPSTTKKEY_6:TESTAL,08HJNZKEY_1CALLKEY5JMPSTTKKEY_1:MOVDX,0602HMOVAL,0FBHOUTDX,ALMOVDX,0600HINAL,DX5TESTAL,04HJNZKEY_5CALLKEY2JMPSTTKKEY_5:TESTAL,08HJNZKEY_0CALLKEY6JMPSTTKKEY_0:MOVDX,0602HMOVAL,0F7HOUTDX,ALMOVDX,0600HINAL,DXTESTAL,04HJNZKEY_4CALLKEY3JMPSTTKKEY_4:TESTAL,08HJNZKEY_C1CALLKEY7KEY_C1:JMPSTTK;--------------------------------------------------------------------KEY0:CALLLP1;按键3处理子程序MOVAL,0EEHMOV[SI+5],ALMOVAL,00HMOV[DI+5],ALCALLDISP;显示RET;返回;--------------------------------------------------------------------KEY1:CALLLP1MOVAL,03EHMOV[SI+5],ALMOVAL,01HMOV[DI+5],ALCALLDISPRET;--------------------------------------------------------------------KEY2:CALLLP1;按键F处理子程序MOVAL,0DEHMOV[SI+5],AL6MOVAL,02HMOV[DI+5],ALCALLDISP;显示RET;返回;--------------------------------------------------------------------KEY3:CALLLP1;按键3处理子程序MOVAL,0E0HMOV[SI+5],ALMOVAL,03HMOV[DI+5],ALCALLDISP;显示RET;返回;--------------------------------------------------------------------KEY4:CALLLP1;按键3处理子程序MOVAL,0F6HMOV[SI+5],ALMOVAL,04HMOV[DI+5],ALCALLDISP;显示RET;返回;--------------------------------------------------------------------KEY5:CALLLP1;按键B处理子程序MOVAL,0F2HMOV[SI+5],ALMOVAL,05HMOV[DI+5],ALCALLDISP;显示RET;返回;--------------------------------------------------------------------KEY6:CALLLP1;按键3处理子程序MOVAL,9EHMOV[SI+5],ALMOVAL,06HMOV[DI+5],ALCALLDISP;显示RET;返回;--------------------------------------------------------------------KEY7:CALLLP1;按键3处理子程序MOVAL,8EHMOV[SI+5],ALMOVAL,07HMOV[DI+5],AL7CALLDISP;显示RET;返回;--------------------------------------------------------------------LP1:MOVSI,OFFSETVA2MOVDI,OFFSETVA3MOVCX,0005H;数据移位保存子程序(前移5位)LP2:MOVAL,[SI+4]MOV[SI+5],ALMOVAL,[DI+4]MOV[DI+5],ALDECSIDECDILOOPLP2RET;--------------------------------------------------------------------DISP:MOVSI,OFFSETVA1;显示子程序MOVDI,OFFSETVA2MOVDL,[DI+5]CMPDL,0FCHJNZDIR5MOVDL,[DI+4]CMPDL,0FCHJNZDIR4MOVDL,[DI+3]CMPDL,0FCHJNZDIR3MOVDL,[DI+2]CMPDL,0FCHJNZDIR2MOVDL,[DI+1]CMPDL,0FCHJNZDIR1JMPDIR0DIR5:MOVCX,0006HJMPDIRDIR4:MOVCX,0005HJMPDIRDIR3:MOVCX,0004HJMPDIRDIR2:MOVCX,0003HJMPDIRDIR1:MOVCX,0002HJMPDIRDIR0:MOVCX,0001H8DIR:MOVDX,0602HMOVAL,[SI]OUTDX,ALMOVDX,0604HMOVAL,[DI]OUTDX,ALCALLTIMEINCSIINCDILOOPDIRRET;--------------------------------------------------------------------TIME:PUSHAX;延时程序PUSHCXMOVCX,0005HTIME1:MOVAX,00F0HTIME2:DECAXJNZTIME2LOOPTIME1POPCXPOPAXRET;--------------------------------------------------------------------STTK:CALLDISP;放键测试程序MOVAL,00HMOVDX,0602HOUTDX,ALMOVDX,0600HINAL,DXANDAL,3CHCMPAL,3CHJNZSTTKJMPSTTCODEENDSENDSTART;--------------------------------------------------------------------课程设计3实现:(1)定义键盘按键,8个为数字键0,1,2,,3、4、5、6、7个功能键:减号—,乘号*,等号=;(2)可进行五位8进制减法运算;9(3)可进行三位8进制乘法运算。源程序:;--------------------------------------------------------------------STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTTABLEDB0FCH,60H,0DAH,0F2H,66H,0B6H,0BEH,0E0HDB0FEH,0F6H,0EEH,3EH,9CH,7AH,9EH,8EHVA1DB0DFH,0EFH,0F7H,0FBH,0FDH,0FEHVA2DB0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCHVA3DB00

1 / 22
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功