您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 七段码电子表显示程序
目录1.题目及要求``````````````````````````````````````````22.功能设计`````````````````````````````````````````````23.详细设计`````````````````````````````````````````````23.1设计方法``````````````````````````````````````````````````````````23.2流程图`````````````````````````````````````````````````````````````23.3重点,难点``````````````````````````````````````````````````````64.总结心得体会```````````````````````````````````````````75.参考文献````````````````````````````````````````````````76.附:源程序```````````````````````````````````````````````711.题目及要求1.1题目:七段码电子表显示程序1.2要求1.七段码电子表显示程序2.菜单选择:设置时,分,秒,开始,退出等3.模拟七段码管显示时,分,秒4.要求界面美2.功能设计说明:esc键退出s键设置时间数据段(1)Disptime,showtime显示时钟(2)定义定义0-9十个图形数字,以便模拟七段码显示时钟宏定义(1)Clear定义清屏宏(2)rowcol定义光标定位宏(3)crlf回车换行宏(4)display显示字符串宏(5)change计算时间宏函数(1)main主函数(2)play主要完成显示七段码电子表显示(3)prog0到prog10完成七段码到一般显示的转换(4)moveshape显示七段码电子表(4)delay延迟函数(5)exit返回DOS函数3.设计详细3.1设计方法(1)Clears清屏宏用到了BIOS中断06H。(2)rowcol光标定位宏用到了BIOS中断02H。(3)crlf回车换行宏用到了DOS中断的0ah,0dh(4)display显示字符串宏用到了DOS中断的09h(5)change计算时间宏用户自己定义的宏,方便以后使用(6)main主函数主要调用子函数实现功能(7)delayr延迟函数用双重循环实现,根据不同机子设置不同的参数(8)exit返回DOS函数,也就是结束函数。调用int21h中的04h(9)moveshape显示七段码电子表函数。利用int21h中的09h3.2流程图2Play函数34Delay函数53.3重点,难点本程序的重点是怎么把系统时间转化成七段码显示出来,先把吧0到9十个数字,利用相对坐标表示出来。然后在依依和系统时间的时、分、秒对比,相等则输出,这样就把系统时间的显示方式,改变成七段码表显示方式了。然而要实现以上功能实在不容易,经过多番努力,最后才实现了系统时间到七段码的转化。接下来设置时间,取DOS中断的2DH,把输入的时间转化成七段码。再下来是加上窗口,优化程序,整理界面,使程序更加好理解。64.总结心得体会学习了汇编语言这门课程,对它有了基本的了解和认识。以为可以对付一些简单的程序的,但是拿到题目还是无从下手。幸好得到了同学的帮助,才一点点起步,到后面完成。最后运行自己程序的时候,喜悦真是难以言表。很感谢帮助过我的同学和老师,没有他们的帮助,我真不知道课程设计能否按时完成。对于所学的这个专业,编写程序是基本技能,可是自己却不能独立完成课程设计,自责的感觉油然而生,我相信在今后的学习中,自己能够吸取教训。5.参考文献1.东扬生等编著:“宏汇编语言MASM6实用大全”,科学出版社,19932.求伯军主编:“新编深入DOS编程”,学苑出版社,19943.沈美明温冬婵主编:“IBM-PC汇编语言程序设计”,清华大学出版社,20016.附:源程序datasegmentDisptimeDB00,00,:,00,00,:,00,00,$showtimedwA10,A11,A12,A13,A14,A15,A16,A17,A18,A19escapeequ1bh;按键ESC退出zhaodb0dh,0ah,'Press's'tosettime.$'db0dh,0ah,'Press'esc'toend!$'bingdb0dh,0ah,'CLOCK$'stimedb9,(?),9dup(?)signdb0;*****定义0-9十个图形数字*****s0db6db5fh,0ah,0,0db7ch,0ah,1,-1db7ch,0ah,1,0db5fh,0ah,0,1db7ch,0ah,0,1db7ch,0ah,-1,0s1db2db7ch,0ah,1,0db7ch,0ah,1,0s2db5db5fh,0ah,0,0db7ch,0ah,1,1db5fh,0ah,0,-17db7ch,0ah,1,-1db5fh,0ah,0,1s3db5db5fh,0ah,0,0db7ch,0ah,1,1db5fh,0ah,0,-1db7ch,0ah,1,1db5fh,0ah,0,-1s4db4db7ch,0ah,1,0db5fh,0ah,0,1db7ch,0ah,1,1db7ch,0ah,-1,0s5db5db5fh,0ah,0,0db7ch,0ah,1,-1db5fh,0ah,0,1db7ch,0ah,1,1db5fh,0ah,0,-1s6db6db5fh,0ah,0,0db7ch,0ah,1,-1db5fh,0ah,0,1db7ch,0ah,1,1db5fh,0ah,0,-1db7ch,0ah,0,-1s7db3db5fh,0ah,0,0db7ch,0ah,1,1db7ch,0ah,1,0s8db7db7ch,0ah,1,0db5fh,0ah,-1,1db7ch,0ah,1,1db5fh,0ah,0,-1db7ch,0ah,1,1db5fh,0ah,0,-1db7ch,0ah,0,-1s9db6db7ch,0ah,1,0db5fh,0ah,-1,1db7ch,0ah,1,1db5fh,0ah,0,-1db7ch,0ah,1,18db5fh,0ah,0,-1s10db2db03h,0ah,1,0db03h,0ah,1,0dataends;...................codesegmentcrlfMACROpushaxpushbxpushcxpushdxmovah,02hmovdl,0ahint21hmovah,02hmovdl,0dhint21hpopdxpopcxpopbxpopaxENDM;....................clearmacroala,ulrow,ulcol,lrrow,lrcol,attpushaxpushbxpushcxpushdxmovah,6moval,ala;属性movbh,ulrow;页号movch,ulcol;左上角行号movcl,lrrow;左上角列号movdh,lrcol;右下角行号movdl,att;右下角列号int10hpopdxpopcxpopbxpopaxendm;........................rowcolmacrorow,col;光标定位9pushaxpushbxpushcxpushdxpushdimovbh,0movdh,rowmovdl,colmovah,02hint10hpopdipopdxpopcxpopbxpopaxendmchangemacroc1,c2,c3;系统时间moval,c1cbwdivbhaddal,'0'movDisptime[c2],aladdah,'0'movDisptime[c3],ahendmchange_1macroc1,c2,c3;设定时间movbh,10moval,stime[c2]subal,'0'mulbhaddal,stime[c3]subal,'0'movc1,alendm;...............................................................................assumecs:code,ds:data;---------------------------------------------------------------------------------;主函数start:movax,datamovds,axnext:calldelaymoval,signcmpal,1bh10jeA1_1cmpal,'s'jesettimejmpA1_2A1_1:jmpexitsettime:rowcol18,22leadx,stimemovah,0ah;接受键盘输入int21hmovah,2movbh,0movdh,18movdl,22int21hchange_1ch,2,3change_1cl,5,6change_1dh,8,9movdl,00movah,2dh;置系统时间int21hcmpal,0jneA1_1jmpA1_2A1_2:clear0,07h,0,0,24,79clear0,44h,4,19,23,60clear0,07h,6,20,7,59clear0,07h,9,20,13,59;从第四行,20列开始clear0,07h,16,20,22,59movah,2movbh,0movdh,6;确定“clock”的输出行movdl,25;确定的clock的输出列int10hmovah,9;显示字符串leadx,bingint21hmovah,2ch;取系统时间int21hmovbh,10changech,0,1changecl,3,4changedh,6,7movdl,0011movbx,0movdh,10movdl,25show:pushdxmovax,dxrowcolah,almoval,Disptime[bx]cmpal,':'jeA20subal,'0'shlal,1CBWMOVSI,AXJMPshowtime[SI]next1:popdxadddx,0004hincbxcmpbx,8jaenext2jmpshownext2:jmpnextA10:callprog0jmpnext1A11:callprog1jmpnext1A12:callprog2jmpnext1A13:callprog3jmpnext1A14:callprog4jmpnext1A15:callprog5jmpnext1A16:callprog6jmpnext1A17:callprog7jmpnext1A18:callprog8jmpnext1A19:callprog9jmpnext1A20:callprog10jmpnext1;............................12prog0procleadi,s0callmoveshaperetprog0endpprog1procleadi,s1callmoveshaperetprog1endpprog2procleadi,s2callmoveshaperetprog2endpprog3procleadi,s3callmoveshaperetprog3endpprog4procleadi,s4callmoveshaperetprog4endpprog5procleadi,s5callmoveshaperetprog5endpprog6procleadi,s6callmoveshaperetprog6endpprog7procleadi,s7callmoveshaperetprog7endpprog8procleadi,s8callmoveshaperet13prog8endpprog9procleadi,s9callmovesha
本文标题:七段码电子表显示程序
链接地址:https://www.777doc.com/doc-64940 .html