| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 720 人关注过本帖
标题:一个秒表程序。怎么实现的记时功能?
只看楼主 加入收藏
痛苦并快乐的
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2006-10-30
收藏
 问题点数:0 回复次数:0 
一个秒表程序。怎么实现的记时功能?
stack segment para stack'stack' ;按0开始启动,再按0重新计时,按除0和1外的任一键暂停
db 100 dup(?)
;再按1继续,再按0从0开始!!! 按Esc退出!!!
stack ends
data segment
buffer dw 5 dup(?)
buffer1 db '0','0',':','0','0','$'
data ends
code segment
assume cs:code,ds:data,ss:stack,es:data
start proc far
begin: mov ax,data
mov ds,ax
mov es,ax
mov ah,01h
mov cx,2000h
int 10h
mov ax,0600h
mov cx,0000h
mov dx,184fh
mov bh,07h
int 10h
mov ah,02h
mov bh,00h
mov dh,02h
mov dl,02h
int 10h
mov dx,offset buffer1
mov ah,9
int 21h
again: mov ah,0
int 16h
cmp al,27d
jz l4
jmp again1
l4: jmp l3
again1: cmp al,30h
jz s1
cmp al,31h
jz goon
jmp again
s1: mov ax,0600h
mov cx,0000h
mov dx,184fh
mov bh,07h
int 10h
mov ah,02h
mov bh,00h
mov dh,02h
mov dl,02h
int 10h
lea di,buffer
lea si,buffer1
mov cl,6
cld
rep movsb
mov dx,offset buffer
mov ah,9
int 21h
mov bx,00h
lea si,buffer
push bx
push bx
goon: mov ah,02h
mov bh,00h
mov dh,02h
mov dl,02h
int 10h
pop bx
mov al,bl
inc al
daa
cmp al,60h
jc next2
pop bx
mov al,bl
inc al
daa
cmp al,60h
jc next1
mov al,0
next1: mov bl,al
push bx
mov dl,al
mov cl,4
shr al,cl
or al,30h
mov [si],al
inc si
mov al,dl
and al,0fh
or al,30h
mov [si],al
mov al,0
lea si,buffer
next2: mov bl,al
push bx
mov dl,al
mov cl,4
shr al,cl
or al,30h
add si,03h
mov [si],al
inc si
mov al,dl
and al,0fh
or al,30h
mov [si],al
inc si
mov al,'$'
mov [si],al
mov dx,offset buffer
mov ah,9
int 21h
mov ah,0h
int 1ah
add dx,18
mov bx,dx
R: mov ah,0h
int 1ah
cmp dx,bx
jnz R
lea si,buffer
mov ah,01h
int 16h
jz a1
jmp again
a1: jmp goon
l3: mov ah,4ch
int 21h
start endp
code ends
end begin
搜索更多相关主题的帖子: 秒表 记时 
2007-01-20 12:38
快速回复:一个秒表程序。怎么实现的记时功能?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017473 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved