求解 王爽汇编实验14
时间:2011-12-06
来源:互联网
用了一个简单的跳转,动态显示时间,但是CPU占用率过高,求简单解决办法assume cs:code
data segment
db 9,8,7,4,2,0
db '/', '/ ',':', ':'
data ends
code segment
start:mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
mov si,0
mov di,120
mov cx,6
s:mov al,[si]
out 70h,al
in al,71h
call s1
mov es:[di],ah
mov es:[di+2],al
mov bl,[si+6]
mov es:[di+4],bl
inc si
add di,6
loop s
mov cx,1000
push ax
pop ax
jmp start
quit:mov ax,4c00h
int 21h
s1:push cx
mov ah,al
mov cl,4
shr ah,cl
and al,00001111b
add ah,30h
add al,30h
pop cx
ret
code ends
end start
data segment
db 9,8,7,4,2,0
db '/', '/ ',':', ':'
data ends
code segment
start:mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
mov si,0
mov di,120
mov cx,6
s:mov al,[si]
out 70h,al
in al,71h
call s1
mov es:[di],ah
mov es:[di+2],al
mov bl,[si+6]
mov es:[di+4],bl
inc si
add di,6
loop s
mov cx,1000
push ax
pop ax
jmp start
quit:mov ax,4c00h
int 21h
s1:push cx
mov ah,al
mov cl,4
shr ah,cl
and al,00001111b
add ah,30h
add al,30h
pop cx
ret
code ends
end start
作者: fengshien 发布时间: 2011-12-06
assume cs:code
code segment
db 9,8,7,4,2,0
db '// :: '
start:mov ax,cs
mov ds,ax
mov si,0
mov ax,0
mov di,0
s:mov al,ds:[si]
mov dl,al
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*12+40*2+di],ah
mov ah,ds:[si+6]
mov byte ptr es:[160*12+40*2+2+di],al
mov byte ptr es:[160*12+40*2+2+2+di],ah
add di,6
inc si
cmp dl,bl
jne short s
je short send
send:nop
mov ax,4c00h
int 21h
code ends
end start
code segment
db 9,8,7,4,2,0
db '// :: '
start:mov ax,cs
mov ds,ax
mov si,0
mov ax,0
mov di,0
s:mov al,ds:[si]
mov dl,al
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*12+40*2+di],ah
mov ah,ds:[si+6]
mov byte ptr es:[160*12+40*2+2+di],al
mov byte ptr es:[160*12+40*2+2+2+di],ah
add di,6
inc si
cmp dl,bl
jne short s
je short send
send:nop
mov ax,4c00h
int 21h
code ends
end start
作者: x90386 发布时间: 2011-12-06
这样 时钟不是就不动了吗
作者: fengshien 发布时间: 2011-12-06
引用 1 楼 x90386 的回复:
assume cs:code
code segment
db 9,8,7,4,2,0
db '// :: '
start:mov ax,cs
mov ds,ax
mov si,0
mov ax,0
m……
assume cs:code
code segment
db 9,8,7,4,2,0
db '// :: '
start:mov ax,cs
mov ds,ax
mov si,0
mov ax,0
m……
这不就不动了吗
作者: fengshien 发布时间: 2011-12-06
还要动态显示……
好吧,我帮你找了个别人写的……
Assembly code
小修改了下,按q退出。
好吧,我帮你找了个别人写的……
Assembly code
assume cs:code data segment db 9,8,7,4,2,0 data ends code segment start: mov ax,data mov ds,ax mov si,0 mov ax,0b800h mov es,ax call next mov di,0 s: mov al,[si] out 70h,al in al,71h mov ah,al mov cx,4 shr ah,cl and al,00001111b add ah,30h add al,30h mov es:[13*0a0h+30+di],ah add di,2 mov es:[13*0a0h+30+di],al add di,4 cmp byte ptr ds:[si],0 jz repeat inc si jmp short s next: 子程序 mov di,4 mov byte ptr es:[13*0a0h+30+di],'/' add di,6 mov byte ptr es:[13*0a0h+30+di],'/' add di,12 mov byte ptr es:[13*0a0h+30+di],':' add di,6 mov byte ptr es:[13*0a0h+30+di],':' ret repeat: mov di,0 mov si,0 in al,60h cmp al,10h jnz s mov ax,4c00h int 21h code ends end start
小修改了下,按q退出。
作者: x90386 发布时间: 2011-12-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28