欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    微机原理与接口技术课程设计报告计程车计价器.doc

    • 资源ID:2928096       资源大小:127.50KB        全文页数:20页
    • 资源格式: DOC        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    微机原理与接口技术课程设计报告计程车计价器.doc

    信息科学与技术学院微机原理与接口技术课程设计报告课 程 题 目: 计程车计价器 学 生 姓 名: 刘郁 学 号: 2009082212 专业、年级 : 计科09级一班 指 导 教 师: 裘 祖 旗 时 间: 2012年1月11 1.题目要求11.1 题目:计程车计价器11.2 要求12、 功能设计12. 1 输出字符串宏 (str)122 定义光标定位宏123 清屏宏 (clearscreen)124 延时模块125 数字显示模块126 数字自增模块22.7 设置单价模块23、 详细设计23.1 主函数23.2 输出字符串宏模块33.1.1 本设计的方法,计算公式33.1.3 本设计的重点、难点和解决方法333将数字显示成数管的形式的disp子程序334 实现自加功能435 延时模块的实现44.程序运行界面55总结56参考文献:67附原程序:61.题目要求1.1 题目:计程车计价器1.2 要求1实现计价功能;2实现手动设计单价3实现显示里程、单价与总价2、 功能设计2. 1 输出字符串宏 (str) 功能:将字符串定义在宏里面,然后输出。22 定义光标定位宏 功能:指定光标的位置。23 清屏宏 (clearscreen)功能:设置开始和结尾的行列数以及属性。24 延时模块 功能:延缓每次显示的时间,使之能够准确的输出。25 数字显示模块 功能:显示所有的数字内容,其中包括行驶过程中的价格,和里程的显示。在数据段中定义数字的格式,通过中断显示出数字能容。光标定位,使数字显示在指定的位置。26 数字自增模块 功能:设计程车每走100m,总价格增加0.2元,起步价为5元。此时在行驶的里程中,不断的加100m,当达到3km的时候,通过cx的判断,使价格从5元开始,每走100m加0.2元。需要用到延时程序,和跳转功能。2.7 设置单价模块 功能:手动设置单价,设定每公里要走的单价。在数据段定义后,每输入一次,通过取数据段的数据,完成定价的功能3、 详细设计3.1 主函数主函数main定义界面Inc cx显示总价,显示里程显示总价,价格增加0.2元/100m显示不响应从键盘输入字符Cx<32?CmpsCmpgYYYNNN3.2 输出字符串宏模块3.1.1 本设计的方法,计算公式 显示字符串是本模块的功能,方法是将字符串传送到dx中,然后用09中断输出。strDx ax压栈字符>dx输出Ax dx出栈结束3.1.2 本模块的流程图 3.1.3 本设计的重点、难点和解决方法 我认为本设计的重点和难点在于字符串的传送,解决方法在于用09输出和字符串的定义一起搭配使用。33将数字显示成数管的形式的disp子程序置光标位置取disptime中的时的十位至al将取得数字乘以16得到其对应在shuzi段的对应显示显示字符串重复上述过程,将时分秒全部显示置光标,并显示字符串置光标,并显示字符串Dx加0634 实现自加功能moval, valuenum+6inc almov valuenum+6,alCmp al,10Nymov valuenum+6,00hmov al,valuenum+4inc almov valuenum+4,al直到最后完成最高位进位35 延时模块的实现Mov bl,75d36Mov cx,6632d检测61h端口的第四位,直到第四位发生改变Cx-1>0YNBl-1>0YN结束4.程序运行界面5总结在这次的课程设计中,学到的知识有很多,收获也不小。可以从理论结合实际,可以把身边的一些所涉及到的编程工具自己也能够体会和学习一下。比如这次所做的计程车计价器。由于能力有限不能拿单片机或仿真的工具来做,只是用汇编基础的模拟了一下,其中也了解到了最基本的原理,锻炼了自己的基础知识水平。可以用到将来的实际应用当中。能够体会到其中的乐趣。但是这次也有许多的问题,首先是自己的编程水平不好,所以做起来速度很慢,需要以后多多练习,实验。有些功能还没有能够实现,所以还需要进一步的学习,要学的知识还有很多,还应该花更多的精力在这些方面,这样才能够提高自己的专业水平。汇编语言和微机接口原理也是最基层的计算机语言和最接近硬件的,只有了解了这里的本质,才能更有效准确的运用其他工具。6参考文献: 1 IBM-PC汇编语言程序设计 沈美明 清华大学出版社 2001年8月第2版 2 IBM-PC汇编语言程序设计例题习题集沈美明 清华大学出版社 1991年6月第1版 3 微机系统和接口应用技术朱世鸿 著 清华大学出版社 2006年9月第1版 7附原程序:data segment valuenum db 00,00,00,".",00,"$"distance valuenum3 db 00,00,05,".",00,"$"price num1 db "total value","$" num2 db "distance","$" num3 db "km","$" num4 db "yuan","$" stop db "*press s to stop!","$" go_on db"*press g to go on","$"shuzi db " _ ",0dh,0ah,"$" db "| |",0dh,0ah,"$" db "|_|",0dh,0ah,"$" db " ",0dh,0ah,"$"db " |",0dh,0ah,"$" db " |",0dh,0ah,"$" db " _ ",0dh,0ah,"$" db " _|",0dh,0ah,"$" db "|_ ",0dh,0ah,"$" db " _ ",0dh,0ah,"$" db " _|",0dh,0ah,"$" db " _|",0dh,0ah,"$" db " ",0dh,0ah,"$" db "|_|",0dh,0ah,"$" db " |",0dh,0ah,"$" db " _ ",0dh,0ah,"$" db "|_ ",0dh,0ah,"$" db " _|",0dh,0ah,"$" db " _ ",0dh,0ah,"$" db "|_ ",0dh,0ah,"$" db "|_|",0dh,0ah,"$" db " _ ",0dh,0ah,"$" db " |",0dh,0ah,"$" db " |",0dh,0ah,"$" db " _ ",0dh,0ah,"$" db "|_|",0dh,0ah,"$" db "|_|",0dh,0ah,"$" db " _ ",0dh,0ah,"$" db "|_|",0dh,0ah,"$" db " _|",0dh,0ah,"$"data endsposcurse macro dh1,dl1 ;定义光标定位宏 push ax push bx push dx mov ah,2h mov bh,0h mov dh,dh1 mov dl,dl1 int 10h pop dx pop bx pop axendmcode segmentassume cS:code,ds:datamain proc far mov ax,data mov ds,ax clear macro aL1,bh1,ch1,cl1,dh1,dl1 MOV AH,06H mov aL,aL1 mov bh,bh1 mov ch,ch1 mov cl,cl1 mov dh,dh1 mov dl,dl1 INT 10H endm clear 0,01000000b,2,3,20,75 clear 0,00011110b,5,5,18,73 mov cx,0B: inc cxcmp cx,32jz ccall disp3call delay call disp2 call delay call delay call inc_2 call delaymov ah,0bhint 21hinc aljnz bmov ah,01hint 21hcmp al,'s'jnz bjmp ac: clear 0,01000000b,2,3,20,75 clear 0,00011110b,5,5,18,73 call disp1;显示价格 call delay call inc_1;价格加2 call delay call disp2;显示里程 call delay call inc_2;里程加2 call delaymov ah,0bhint 21hinc aljnz cmov ah,01hint 21hcmp al,'s'jnz cjmp am:jmp ba:mov ah,0bhint 21hinc aljnz amov ah,01hint 21hcmp al,'g'jnz amov al,valuenumcmp al,0ja cmov al,valuenum+1cmp al,0ja cmov al,valuenum+2cmp al,3ja ccmp al,3jnz mjmp cRETmain endp;-output子程序-output proc nearpush axmov ah,09hint 21hpop axretoutput endp;inc_1 子程序inc_1 proc near push ax mov al,valuenum3+4 inc al inc al mov valuenum3+4,al cmp al,0ah jnz return3 mov valuenum3+4,00h mov al,valuenum3+2 inc al mov valuenum3+2,al cmp al,0ah jnz return3 mov valuenum3+2,00h mov al,valuenum3+1 inc al mov valuenum3+1,al cmp al,0ah jnz return3 mov valuenum3+1,00h mov al,valuenum inc al mov valuenum3,al cmp al,0ah jnz return3 mov valuenum3,00h return3:pop axretinc_1 endp;inc_2 子程序inc_2 proc near push ax mov al,valuenum+4 inc al mov valuenum+4,al cmp al,0ah jnz return mov valuenum+4,00h mov al,valuenum+2 inc al mov valuenum+2,al cmp al,0ah jnz return mov valuenum+2,00h mov al,valuenum+1 inc al mov valuenum+1,al cmp al,0ah jnz return mov valuenum+1,00h mov al,valuenum inc al mov valuenum,al cmp al,0ah jnz return mov valuenum,00h return:pop axretinc_2 endp ;-delay子程序-delay proc nearpush bxpush axpush cxmov bl,75dwaitf2:mov cx,1000d waitf1:in al,61hand al,10hcmp al,ahje waitf1mov ah,alloop waitf1dec blcmp bl,0jnz waitf2pop cxpop axpop bx retdelay endp;-disp1子程序, 从5开始显示-disp1 proc near lea dx,num1 poscurse 09h,6h call output lea dx,num2 poscurse 0ch,08h call output lea dx,num3 poscurse 0ch,23h call output lea dx,num4 poscurse 09h,23h call output lea dx,stop poscurse 12h,06h call output lea dx,go_on poscurse 12h,30h mov ah,09h int 21h mov al,valuenum3 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,13h add dx,ax call output poscurse 08h,13h add dx,06h call output poscurse 09h,13h add dx,06h call output poscurse 07h,16h mov al,valuenum3+1 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,16h add dx,ax call output poscurse 08h,16h add dx,06h call output poscurse 09h,16h add dx,06h call output poscurse 07h,19h mov al,valuenum3+2 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,19h add dx,ax call output poscurse 08h,19h add dx,06h call output poscurse 09h,19h add dx,06h call output poscurse 09h,1ch mov dl,2eh mov ah,02h int 21h poscurse 07h,1eh mov al,valuenum3+4 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,1eh add dx,ax call output poscurse 08h,1eh add dx,06h call output poscurse 09h,1eh add dx,06h call output ret disp1 endp;-disp2子程序-disp2 proc near push ax mov al,valuenum mov bl,12h mul bl mov dx,offset shuzi poscurse 0ah,13h add dx,ax call output poscurse 0bh,13h add dx,06h call output poscurse 0ch,13h add dx,06h call output poscurse 0ah,16h mov al,valuenum+1 mov bl,12h mul bl mov dx,offset shuzi poscurse 0ah,16h add dx,ax call output poscurse 0bh,16h add dx,06h call output poscurse 0ch,16h add dx,06h call output poscurse 0ah,19h mov al,valuenum+2 mov bl,12h mul bl mov dx,offset shuzi poscurse 0ah,19h add dx,ax call output poscurse 0bh,19h add dx,06h call output poscurse 0ch,19h add dx,06h call output poscurse 0ch,1ch mov dl,2eh mov ah,02h int 21h poscurse 0ah,1eh mov al,valuenum+4 mov bl,12h mul bl mov dx,offset shuzi poscurse 0ah,1eh add dx,ax call output poscurse 0bh,1eh add dx,06h call output poscurse 0ch,1eh add dx,06h call output pop axret disp2 endp;-disp3子程序-disp3 proc near lea dx,num1 poscurse 09h,6h mov ah,09h int 21h lea dx,num2 poscurse 0ch,8h mov ah,09h int 21h lea dx,num3 poscurse 0ch,23h call output lea dx,num4 poscurse 09h,23h call output lea dx,stop poscurse 12h,06h mov ah,09h int 21h lea dx,go_on poscurse 12h,30h call output mov al,valuenum3 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,13h add dx,ax call output poscurse 08h,13h add dx,06h call output poscurse 09h,13h add dx,06h call output poscurse 07h,16h mov al,valuenum3+1 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,16h add dx,ax call output poscurse 08h,16h add dx,06h call output poscurse 09h,16h add dx,06h call output poscurse 07h,19h mov al,valuenum3+2 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,19h add dx,ax call output poscurse 08h,19h add dx,06h call output poscurse 09h,19h add dx,06h call output poscurse 09h,1ch mov dl,2eh mov ah,02h int 21h poscurse 07h,1eh mov al,valuenum3+4 mov bl,12h mul bl mov dx,offset shuzi poscurse 07h,1eh add dx,ax call output poscurse 08h,1eh add dx,06h call output poscurse 09h,1eh add dx,06h call output ret disp3 endp code ends end main

    注意事项

    本文(微机原理与接口技术课程设计报告计程车计价器.doc)为本站会员(仙人指路1688)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开