您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 酒店餐饮 > 时钟模拟显示软件设计
课程设计任务书学生姓名:专业班级:指导教师:工作单位:题目:时钟模拟显示软件设计初始条件:带有编辑器、汇编程序、连接程序和调试程序的电脑一台。要求完成的主要任务:(包括课程设计工作量及其技术要求,以及说明书撰写等具体要求)采用汇编语言设计一个运行于计算机的时钟模拟显示软件,在出现的提示信息中输入大写字母“D”,可显示系统当前日期;输入大写字母“T”,可显示系统当前时间。按Q退出程序。(1)设计任务及要求分析(2)方案比较及认证说明(3)系统原理阐述(4)软件设计课题需要说明:软件思想,流程图,源程序及程序注释(5)调试记录及结果分析(6)总结(7)参考资料(8)附录:芯片资料或程序清单,软件演示屏幕拷贝图或硬件实物图时间安排:12月31日~1月2日:收集资料,方案选择1月3日~1月8日:整体流程,程序细节1月9日~1月10日:调试程序,报告撰写1月11日:交设计报告,程序演示,答辩指导教师签名:年月日系主任(或责任教师)签名:年月日目录摘要···············································································································11设计思路·······································································································21.1设计任务及要求的分析············································································21.2程序流程图···························································································22软件设计·······································································································42.1背景格局设计························································································42.2文本方式设置························································································42.3获取系统日期和时间···············································································42.4日期有关子程序·····················································································52.4.1日期显示子程序·············································································52.4.2日期转换ASCII码字符子程序···························································62.5时间有关子程序·····················································································72.5.1时间显示子程序·············································································72.5.2时间转换ASCII码字符子程序···························································83调试过程和运行结果及分析·············································································103.1调试过程·····························································································103.2运行结果·····························································································113.3结果分析·····························································································124总结···········································································································13附录1程序源程序··························································································14附录2程序运行结果·······················································································20附录3程序资料·····························································································22参考文献·······································································································23《微机原理与接口技术》课程设计说明书1摘要汇编语言(AssemblyLanguage)是面向机器的程序设计语言。汇编语言是一种功能很强的程序设计语言,也是利用计算机所有硬件特性并能直接控制硬件的语言。汇编语言,作为一门语言,保持了机器语言的优点,具有直接和简捷的特点,可有效地访问、控制计算机的各种硬件设备,如磁盘、存储器、CPU、I/O端口等,且目标代码简短,占用内存少,执行速度快,是高效的程序设计语言。它经常与高级语言配合使用,应用十分广泛。对于不同型号的计算机,有着不同的结构的汇编语言。汇编语言由于采用了助记符号来编写程序,比用机器语言的二进制代码编程要方便些,在一定程度上简化了编程过程。汇编语言的特点是用符号代替了机器指令代码,而且助记符与指令代码一一对应,基本保留了机器语言的灵活性。使用汇编语言能面向机器并较好地发挥机器的特性,得到质量较高的程序。汇编语言是面向具体机型的,它离不开具体计算机的指令系统,因此,对于不同型号的计算机,有着不同的结构的汇编语言,而且,对于同一问题所编制的汇编语言程序在不同种类的计算机间是互不相通的。汇编语言中由于使用了助记符号,用汇编语言编制的程序输入计算机,计算机不能象用机器语言编写的程序一样直接识别和执行,必须通过预先放入计算机的汇编程序中进行加工和翻译,才能变成能够被计算机直接识别和处理的二进制代码程序。用汇编语言等非机器语言书写好的符号程序称为源程序,运行时汇编程序要将源程序翻译成目标程序。目标程序是机器语言程序,当它被安置在内存的预定位置上,就能被计算机的CPU处理和执行。本次微机原理课程设计的题目是时钟模拟显示软件设计,要求采用汇编语言设计一个运行于计算机的时钟模拟显示软件,在出现的提示信息中输入大写字母“D”,可显示系统当前日期;输入大写字母“T”,可显示系统当前时间,按Q退出程序。要获取系统日期和时间就必须采用DOS系统调用功能。调用系统日期和时间分别应用2AH号和2CH号系统功能,将日期和时间都以二进制存入个寄存器中,要想显示出来必须转化成ASCII码才行。关键字:汇编语言汇编程序时钟模拟DOS系统《微机原理与接口技术》课程设计说明书2时钟模拟显示软件设计1设计思路1.1设计任务及要求的分析采用汇编语言设计一个运行于计算机的时钟模拟显示软件,在出现的提示信息中输入大写字母“D”,可显示系统当前日期;输入大写字母“T”,可显示系统当前时间。按Q退出程序。根据任务数的要求,可知需要设计的计算机时钟模拟显示软件程序是基于汇编语言的WINDOWS应用程序设计。程序运行成功后,页面出现数字式的时钟,树脂中的钟面为一个规则的矩形。当输入大写字母“D”,可显示系统当前日期,其显示格式是:××××××××,依次为年、月、日。当输入大写字母“T”,可显示系统当前时间,其显示格式是:××:××:××,依次为时、分、秒,小时为二十四进制,分和秒都为六十进制。1.2程序流程图根据课程设计任务及要求,在编写程序前,我们可以绘制程序流程图,这样有助于程序的编写,保持清晰的思路。程序流程图如图1所示。《微机原理与接口技术》课程设计说明书3图1计算机时钟模拟程序流程图《微机原理与接口技术》课程设计说明书42软件设计2.1背景格局设计对于计算机模拟的时钟,在显示时,加入一些背景作为修饰可以使时钟更加的美观。对背景格局修饰的初始化程序段如下:SPACEDB1000DUP('')PATTERNDB6DUP(''),0C9H,26DUP(0CDH),0BBH,6DUP('')DB6DUP('#'),0BAH,26DUP(20H),0BAH,6DUP('#')DB6DUP(''),0C8H,26DUP(0CDH),0BCH,6DUP('')BUFF1DB8DUP(':'),12DUP('')BUFF2DB20DUP('')XDB0DH,0AH,'Pleaseinputdate(D)ortime(T)orquit(Q):$'2.2文本方式设置文本显示方式如表1所示。表1常用的几种显示方式AH调用参数AL显示方式000040×25黑白文本方式000140×25彩色文本方式000280×25黑白文本方式000380×25彩色文本方式0004320×200彩色文本方式0005320×200黑白文本方式0006640×200黑白文本方式本课程设计采用40×25彩色文本方式,所以设置显示方式的程序段如下:MOVAX,0001HINT10H2.3获取系统日期和时间系统日期的调用程序段:MOVAH,2AH《微机原理与接口技术》课程设计说明书5INT21H系统时间的调用程序段:MOVAH,2CHINT21H2.4日期有关子程序2.4.1日期显示子程序日期显示子程序模块设计功能为实时调用系统日期并将其显示,系统日期调用应用2AH号系统功能,将年月日都以二进制存入各寄存器中,要想显示出来必须转化为ASCII码才行。具体程序如下:DATEPROCNEAR;显示日期子程序DISPLAY:MOVAH,2AH;获取日期INT21HMOVSI,0MOVAX,CXMOVBX,100DIVBLMOVBL,AHCALLBCDASC1;日期数值转换成相应的ASCII码字符MOVAL,BLCALLBCDASC1INCSIMOVAL,DHCALLBCDASC1INCSIMOVAL,DLCALLBCDASC1MOVBP,OFFSETBUFF2MOVDX,0C0DHMOVCX,20MOVBX,002EH《微机原理与接口技术》课程设计说明书6MOVAX,1301HINT10HMOV
本文标题:时钟模拟显示软件设计
链接地址:https://www.777doc.com/doc-3435466 .html