当前位置: 代码迷 >> 汇编语言 >> 汇编语言写的一个电子时钟。有个有关问题
  详细解决方案

汇编语言写的一个电子时钟。有个有关问题

热度:2928   发布时间:2013-02-26 00:00:00.0
汇编语言写的一个电子时钟。有个问题
[code=Assembly][/code]
assume cs:code
code segment
start: mov ax,0b800h
mov es,ax
mov di,0
mov ax,0
mov cx,2000
clr: mov es:[di],ax
add di,2
loop clr

time: mov al,9
out 70h,al
in al,71h

mov ah,al
mov cl,4
shr ah,cl
and al,00001111b

add ah,30h
add al,30h

mov bx,0b800h
mov es,bx
mov byte ptr es:[160*10+30*2],ah
mov byte ptr es:[160*10+30*2+2],al

mov al,'/'
mov byte ptr es:[160*10+30*2+4],al

mov al,8
out 70h,al
in al,71h

mov ah,al
mov cl,4
shr ah,cl
and al,00001111b

add ah,30h
add al,30h

mov byte ptr es:[160*10+30*2+6],ah
mov byte ptr es:[160*10+30*2+8],al

mov al,'/'
mov byte ptr es:[160*10+30*2+10],al

mov al,7
out 70h,al
in al,71h

mov ah,al
mov cl,4
shr ah,cl
and al,00001111b

add ah,30h
add al,30h

mov byte ptr es:[160*10+30*2+12],ah
mov byte ptr es:[160*10+30*2+14],al

mov al,' '
mov byte ptr es:[160*10+30*2+16],al

mov al,4
out 70h,al
in al,71h

mov ah,al
mov cl,4
shr ah,cl
and al,00001111b

add ah,30h
add al,30h

mov byte ptr es:[160*10+30*2+18],ah
mov byte ptr es:[160*10+30*2+20],al

mov al,':'
mov byte ptr es:[160*10+30*2+22],al

mov al,2
out 70h,al
in al,71h

mov ah,al
mov cl,4
shr ah,cl
and al,00001111b

add ah,30h
add al,30h

mov byte ptr es:[160*10+30*2+24],ah
mov byte ptr es:[160*10+30*2+26],al

mov al,':'
mov byte ptr es:[160*10+30*2+28],al

mov al,0
out 70h,al
in al,71h

mov ah,al
mov cl,4
shr ah,cl
and al,00001111b

add ah,30h
add al,30h

mov byte ptr es:[160*10+30*2+30],ah
mov byte ptr es:[160*10+30*2+32],al

mov al,00001110b
mov di,1
mov cx,17
color: mov es:[160*10+30*2+di],al
inc di
inc di
loop color


jmp far ptr time

mov ax,4c00h
int 21h
code ends
end start



发现CPU使用率相当高。谁有好办法

------解决方案--------------------------------------------------------
链到INT 1Ch中
  相关解决方案