汇编小问题,求高手来看看!!!!!
4786 点击·2 回帖
![]() | ![]() | |
![]() | 如何用汇编编写一个计时器,要求计时即可,即
00:00:00 然后刷屏, 00:00:01 继续刷屏, .…… | |
![]() | ![]() |
![]() | ![]() | |
![]() | 亲们,我自己做出来了,在MASM611里面运行的代码;给喜欢汇编的朋友做查考!
data segment time db 'Now the system time is $' press db 'Press any key to exit! $' data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax begin:call clear lea dx,time mov ah,9 int 21h mov ah,2ch int 21h mov ax,0 mov al,ch call lbr mov dl,':' mov ah,2 int 21h mov ax,0 mov al,cl call lbr mov dl,':' mov ah,2 int 21h mov ax,0 mov al,dh call lbr call hc lea dx,press mov ah,9 int 21h call hc call waitz mov ah,0bh int 21h inc al je exit jmp begin hc proc mov dl,0dh mov ah,2 int 21h mov dl,0ah mov ah,2 int 21h ret hc endp lbr proc mov dl,10 div dl mov bh,ah mov dl,al add dl,30h mov ah,2 int 21h mov dl,bh add dl,30h mov ah,2 int 21h ret lbr endp clear proc mov al,0 mov cx,0 mov dh,48 mov dl,79 mov bh,7 mov ah,6 int 10h ret clear endp zh proc add dl,30h mov ah,2 int 21h ret zh endp waitz proc mov cx,65535 push ax next2: in al,61h add ah,10h cmp al,ah loop next2 pop ax ret waitz endp exit: mov ah,4ch int 21h code ends end start | |
![]() | ![]() |