ImageVerifierCode 换一换
格式:DOCX , 页数:12 ,大小:72.15KB ,
资源ID:822942      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/822942.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(汇编小闹钟.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

汇编小闹钟.docx

1、汇编小闹钟实验 题目小闹钟程序教 师 评 语评价指标: 题目内容完成情况 优 良 中 差 对原理的理解程度 优 良 中 差 程序设计水平 优 良 中 差 实验报告结构清晰 优 良 中 差 实验总结和分析详尽 优 良 中 差 实验报告一、实验目的通过本综合性、设计性实验使学生进一步巩固课堂所学,全面熟悉、掌握8088宏汇编语言程序设计的基本方法和技巧,进一步提高编写程序、阅读分析程序及上机操作、调试程序的能力。二、实验要求 1 从键盘输入闹铃时间2 程序开始记时,并在屏幕上显示时间(如00:00:01)并实时刷新3 时间到,则发出闹铃声,声音维持数秒;同时时间停止刷新三、实验原理分析 1 由键盘

2、输入十进制字符,转化为二进制数值,并保存作为响铃时间 2 调用2ch中断获取系统时间,在循环中并用回车返回刷新时间 3 将系统实时时间与保存的时间比较,相等则响铃四、流程图 五、源程序data segmentline1 db =Alarm Clock=,$set db * Please input the ringbell time:,$h db * Hour:,$m db * Munite:,$s db * Second:,$crf db 0ah,0ah,$now db * The start time : ,$cur db =current=,$nh dw 0nm dw 0ns dw 0c

3、r db 0dh,0ah,$br db 0dh,$rin db * The time is reach!,$err db * quit input 0:,$line2 db =Clock Close=,$line3 db =Clock Start=,$data ends ;*code segment main proc far assume cs:code,ds:datastart: push ds sub ax,ax push ax mov ax,data mov ds,ax ;输出=Alarm Clock= mov ah,9 lea dx,line1 int 21h call dropli

4、ne ;输出Please input the ringbell time: mov ah,9 lea dx,now int 21h ;2ch号功能调用,取系统时间:ch,cl,dh中分别存放时分秒 mov ah,2ch int 21h call displayTime call dropline ;输入响铃时间 call input ;输出=Clock Start= lea dx,line3 mov ah,9 int 21h call dropline ;若输入出错,可输入“0”退出 lea dx,err mov ah,9 int 21h mov ah,1 int 21h cmp al,0 j

5、z exit call dropline ;输出=current= lea dx,cur mov ah,9 int 21h call dropline ;实时刷新时间,并检查响铃时间是否到了s0: call displayTime ;消除光标 mov cx,2000h mov ah,01h int 10h ;回车刷新 mov ah,9 lea dx,br int 21h mov ah,2ch int 21h ;比较时 mov al,ch cbw cmp ax,nh jnz s0 ;比较分 mov al,cl cbw cmp ax,nm jnz s0 ;比较秒 mov al,dh cbw cmp

6、 ax,ns jnz s0 call dropline ;响铃 call ringbell call dropline ;结束输出=Clock Close= mov ah,9 lea dx,line2 int 21h exit: retmain endp;*;响铃控制ringbell proc near push bx push cx mov ah,9 lea dx,rin int 21h mov bx,30000 mov cx,30000 call sound pop cx pop bx retringbell endp;*;发声子程序,参数为BX,CXsound proc near pus

7、h dx push ax mov dx,cx in al,61h and al,10101010btrig: xor al,2 out 61h,al mov cx,bx delay: loop delay dec dx jne trig pop ax pop dx retsound endp;*;接收输入的时分秒,存入nh,nm,nsinput proc near push dx push ax ;输出Please input the ringbell time: mov ah,9 lea dx,set int 21h call dropline ;接收时 mov ah,9 lea dx,h

8、int 21h call tansfer call dropline mov nh,ax ;接收分 mov ah,9 lea dx,m int 21h call tansfer call dropline mov nm,ax ;接收秒 mov ah,9 lea dx,s int 21h call tansfer call dropline mov ns,ax pop dx pop ax ret input endp;*;输出参数ax存放接受的十进制数实际大小tansfer proc near push bx mov ax,0 mov ah,1 int 21h sub al,30h mov bl

9、,al mov ah,1 int 21h sub al,30h mov bh,al mov al,bl mov bl,10 mul bl mov bl,bh mov bh,0 add ax,bx pop bx rettansfer endp;*displayTime proc near mov al,ch ;小时的值赋给al cbw ;al扩展成ax,用做除法的被除数 call bindecmov dl,: ;显示: mov ah,02h int 21h mov al,cl ;分 cbw call bindec mov dl,: ;显示: mov ah,02h int 21h mov al,d

10、h ;秒 cbw call bindec ret displayTime endp ;*bindec proc nearpush ax push cx push dx mov dx,0 mov cx,10d div cx mov bx,dx ;先保存余数mov dl,al ;显示商(即十进制二位数的十位)or dl,30h mov ah,02h int 21h mov dx,bx ;恢复余数的值(十进制二位数的个位) add dl,30h mov ah,02h int 21h pop dx pop cx pop ax ret bindec endp ;*;输出空行dropline proc near push ax push dx mov ah,9 lea dx,cr int 21h pop dx pop ax retdropline endp;*code ends end start 六、程序测试 1.输入响铃时间,选择“0”可以退出2.current处动态刷新时间3时间到响铃

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1