暖气管上水用球阀好吗:关于汇编语言的问题(大侠,帮帮忙吧)

来源:百度文库 编辑:中科新闻网 时间:2024/05/06 06:37:01
data segment
mesg1 db 0dh,0ah,'your program is very good!'.'$'
mesg2 db 0dh,0ah,'just wait!',0dh,0ah,'$'
count1 db 30h,31h,32h,33h,34h,35h,36h,37h,38h,39h
data ends
code segment
assume cs:code,ds:data
start:mov ax,data
mov ds,ax
mov dx,283h ;向8253写控制字
mov al,36h ;设0计数器为工作方式3
out dx,al
mov ax,5000 ;写入初值5000
mov dx,280h
out dx,al ;先写入低字节
mov al,ah
out dx,al ;后写入高字节
mov dx,283h
mov al,76h ;设计数器为工作方式
out dx,al
mov ax,6000 ;写入初值3000
mov dx,281h
out dx,al ;先写入低字节
mov al,ah
out dx,al ;后写入高字节
mov si,offset count1
count:mov ah,1 ;判断是否有键按下
int 16h
jne exit ;有,则退出
ll:mov dx,283h ;锁存计数器1的计数值
mov al,46h
out dx,al
mov dx,281h ;读计时器1的计数值(先低位后高位)
in al,dx
mov bl,al
in al,dx
mov bl,al
in al,dx
mov bh,al
cmp bx,3
ja count
mov dl,[si]
mov ah,2
int 21h
inc si
mov dx,offset mesg1 ;显示提示信息
mov ah,09h
int 21
mov dx,offset mesg2 ;显示提示信息
mov ah,09h
int 21h
mov cx,0fffh
delay:loop delay ;利用指令时钟延时
jmp count
exit:mov ah,4ch ;返回DOS
int 21h
code ends
end start

修改以上程序,改变计数器的初值,使显示间隔为15秒,且在显示3次后,自动退出。
本题是要用单片机的

是用在单片机上的吗,我运行了一下,没有反应