让计数器计数16次,数码管显示0-15如何修改8253实验计数器实验(附8253计数器实验源程序)
control equ 203h
count0 equ 200h
count1 equ 201h
count2 equ 202h
c8279 equ 20ah
d8279 equ 208h
ledmod equ 00h
ledfeq equ 38h
code segment
assume cs:code
start:push cs
pop ds
mov dx,c8279
mov al,ledmod
out dx,al
mov dx,c8279
mov al,0d3h
out dx,al
mov al,30h; 00110000b
mov dx,control
out dx,al
mov ax,0005h
mov dx,count0
out dx,al
mov al,ah
out dx,al
ll:
mov al,00h
mov dx,control
out dx,al
mov dx,count0
in al,dx
cmp al,0
je exit
mov bl,al
in al,dx
mov dx,c8279
mov al,80h
out dx,al
mov al,bl
lea bx,led
xlat
mov dx,d8279
out dx,al
jmp ll
exit:
mov dx,c8279
mov al,0d3h
out dx,al
jmp $
led db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh
code ends
end start
已退回1积分