[汇编] 屏幕中间显示数字时钟
2014-06-05 17:43
337 查看
;显示系统时间程序 data segment ; add your data here! hour db '?' minute db '?' second db '?' time db "00:00:00$" temp db '?' now db '?' want db '?' pkey db "press any key...$" ends stack segment dw 128 dup(0) ends code segment ;--------------------------------------------- main proc far call init_register ;初始化 SiXunHuan: mov want,1D ;延时3S call delay call setshow call show_time ;显示 loop SiXunHuan call last_show ;结果 ret main endp; ;--------------------------------------------- init_register proc near;set segment registers: mov ax, data mov ds, ax mov es, ax ret init_register endp ;--------------------------------------------- show_time proc near ;时间子程序 mov ah,2Ch int 21h ;获取时间 mov hour,ch mov minute,cl mov second,dh mov ax,0 ;计算到字符串时间 mov al,hour mov temp,10D div temp add al,30H mov time[0],al add ah,30H mov time[1],ah mov ax,0 mov al,minute mov temp,10D div temp add al,30H mov time[3],al add ah,30H mov time[4],ah mov ax,0 mov al,second mov temp,10D div temp add al,30H mov time[6],al add ah,30H mov time[7],ah lea dx,time ;10中断显示时间 mov ah,09H int 21H ret show_time endp ;--------------------------------------------- last_show proc near ;最后显示东西 lea dx, pkey ; output string at ds:dx mov ah, 9 int 21h ; wait for any key....and end mov ah, 1 int 21h mov ax, 4c00h ; exit to operating system. int 21h ret last_show endp ;--------------------------------------------- delay proc near ;延时函数,放在want为想要延时的秒数 mov ah,2Ch int 21h ;获取时间 mov now,dh mov ax,0 mov al,now add al,want mov temp,60D div temp mov want,ah del: mov ah,2Ch int 21h cmp dh,want jz next loop del next: ret delay endp ;--------------------------------------------- setshow proc near ;设置光标位置位置 mov dh,12 ;row-1 mov dl,34 ;columun-1 mov bh,0 mov ah,2 int 10h setshow endp ;--------------------------------------------- clear proc near ret clear endp ;--------------------------------------------- end code end
相关文章推荐
- 汇编之将数字转化为十进制显示在屏幕上
- [汇编语言]-第九章 在屏幕中间分别显示绿底红色,白底蓝色字符串"welcome to masm!"
- 汇编题目:在屏幕中间显示a-z的所有字母,按ESC键改变字符颜色
- 汇编——在屏幕中间显示不同颜色的字符串
- [汇编] 在屏幕中央显示时钟
- 汇编屏幕显示3位数字子程序
- 用汇编写的在PC机上显示的模拟数字时钟
- 汇编将数据以十进制格式显示在屏幕上
- C#在后台注册一个脚本,打开一个子窗口,显示在屏幕中间,关闭子窗体刷新子窗体代码
- 使用WindowManager窗口管理员,把View显示在屏幕中间
- 为什么这个汇编程序,不能在屏幕上面显示!
- 汇编语言:在屏幕上随机显示矩形色块,分手动和自动模式。
- 如何始终在屏幕中间显示Div
- 始终在屏幕中间显示Div的代码(css+js)
- 键盘输入的数字在串口调试助手显示,然后再到数码管(汇编语言版本)
- 运行java时,窗体在屏幕中间显示的代码
- Windows Mobile Tips - 数字时钟的显示
- 手机数字时钟动态显示
- Swing中如何将窗口显示在屏幕正中间
- 汇编程序在屏幕显示字符