文章作者 100test 发表时间 2007:05:08 16:23:12
来源 100Test.Com百考试题网
9月11号上午的考题
8253性质通道1方式0,手动输入单脉冲,out1给8255的pa0,8255a口输入c口输出给8个指示灯。
当pa0=0的时候指示灯每隔一个亮,且间隔一秒
当pa0=1的时候指示灯每隔两个亮,且间隔一秒
9月10日下午考题
8253通道1方式0,记数初值3,out1输出到pa0口,8255方式0,a口输入,c 口输出到LED灯上,当PA0=0时,01010101-10101010循环,当PA0=1时,00110011-11001100循环,有键按下返回DOS.
9月6日上午题
8255A c口低四位输入,a口输出到数码段,当pc0=0 时,a口输出是加一循环(0~f),pc0=1时,a口输出是减一循环(f~0),输出时延一秒钟,有键按下就退出...
data segment
led db 71h,79h,3fh,39h,7fh,77h,67h,7fh
db 07h,7ch,6dh,6eh,4fh,5bh,06h,3fh
count db 0(定义循环初始值为零)
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov dx,28bh
mov al,81h
out dx,al(8255初始化)
input:
mov dx,28ah
in al,dx
and al,0fh
and al,01h(判断pc0)
jz a1
mov al,count
and al,0fh(要屏蔽高四位,以免超过15后出乱码)
lea bx,led
xlat
mov dx,288h
out dx,al
call delay(延迟子程序老师会给出)
dec count
mov ah,1
int 16h
jz input(判断是否有键按下,无则继续判断pc0)
jmp a2(有则返回dos)
a1: mov al,count
and al,0fh
lea bx,led
xlat
mov dx,288h
out dx,al
call delay
inc count
mov ah,1
int 16h
jz input
a2: mov ah,4ch
int 21h
delay proc near
.
.
.
delay endp
code ends
end start