2 yf924092 yf924092 于 2013.10.11 11:36 提问

下面的汇编程序应该动态的显示时钟,谁能帮忙修改一下,万分感谢

assume cs : code , ds : data

data segment

db 9 , 8 , 7 , 4 ,   2,0
db '///:: '

data ends

stack segment
dw 8 dup(0)
stack ends

code segment
start:
mov ax , data
mov ds , ax

mov ax , stack
mov ss , ax
mov sp , 10F

mov si , 0 
mov di , 6

mov ax , 0B800h
mov es , ax

mov cx , 6

l: mov al , [si]
call trans

mov es:[bx] , ah
mov es:[bx+2] , al
mov al ,ds:[di]
mov es:[bx+4] , al
inc si
inc di
add bx , 6

loop l


;jmp short start //当把这个注释去掉之后程序就不对了
mov ax , 4c00h
int 21h

trans:
push cx
out 70h , al
in al , 71h

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

Csdn user default icon
上传中...
上传图片
插入图片