2012年自考微型计算机及接口技术题六_第2页
来源:
考试网 [ 2012年2月29日 ] 【大 中 小】
mov cl,al ;注意别破坏了
mov bx,offset led
xlat
mov dx,288h
out dx,al
mov al,cl ;注意别破坏了
call disp
mov ah,1
int 16h
jz inout
mov ah,4ch
int 21h
disp proc near
push dx
and al,0fh
mov dl,al
cmp dl,9
jle num
add dl,7
num: add dl,30h
mov dah,02h
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
pop dx
ret
disp endp
code ends
end start
3月22日接口上机试题(下午)
题目: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
责编:snrvge