北大“接口技术”上机类型题目及答案(3)
《自考视频课程》名师讲解,轻松易懂,助您轻松上岸!低至199元/科!
10. 8253通道0方式0,计数值为0Fh,手动逐个输入脉冲,从计算机显示器上显示对应的数。
code segment
assume cs:code
start: mov dx,283h
mov al,10h
out dx,al
mov dx,280h
mov al,0fh
out dx,al
l1: mov dx,280h
in al,dx
call disp
mov ah,1
int 16h
jz l1
mov ah,4ch
int 21h
disp proc near
push dx
and al,0fh
mov dl,al
cmp dl,9
jbe num
add dl,7
num: add dl,30h
mov ah,02h
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
pop dx
ret
disp endp
code ends
end start
11. 8253通道0方式0,从8255C口读入计数值,手动逐个输入脉冲,从A口输出在数码管显示其值。
code segment
assume cs:code
start: mov dx,28bh
mov al,88h
out dx,al
mov dx,28ah
in al,dx
mov cl,4
shr al,cl
and al,0fh
mov bl,al
mov dx,283h
mov al,10h
out dx,al
mov al,bl
mov dx,280h
out dx,al
l1: mov dx,280h
in al,dx
mov dx,288h
out dx,al
mov ah,1
int 16h
jz l1
mov ah,4ch
int 21h
code ends
end start
12. 8253通道1方式1(硬件可重触发),计数值0Fh,用8255A口输出在数码管显示值,有键按下返回DOS,无键按下继续执行。
data segment
led db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,39h,5eh,79h,71h
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
lea bx,led
mov dx,28bh
mov al,80h
out dx,al
mov dx,283h
mov al,52h
out dx,al
mov al,0fh
mov dx,281h
out dx,al
l1: mov dx,281h
in al,dx
xlat
mov dx,288h
out dx,al
push dx
mov ah,06h
mov dl,0ffh
int 21h
pop dx
jz l1
mov ah,4ch
int 21h
code ends
end start
13. 8253通道1方式0,计数值为0Fh,手动逐个输入脉冲,用8255C口输出在数码管显示其值,并在计算机显示器显示,但计算机上显示顺序为0~F递增。
data segment
led db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,39h,5eh,79h,71h
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
lea bx,led
mov dx,28bh
mov al,80h
out dx,al
mov dx,283h
mov al,50h
out dx,al
mov al,0fh
mov dx,281h
out dx,al
l2: mov dx,281h
in al,dx
call disp
xlat
mov dx,28ah
out dx,al
mov ah,1
int 16h
jz l2
mov ah,4ch
int 21h
disp proc near
push dx
push ax
mov cl,0fh
sub cl,al
mov al,cl
cmp al,0ah
jb d1
add al,07h
d1: add al,30h
mov dl,al
mov ah,02h
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
pop ax
pop dx
ret
disp endp
code ends
end start
本文标签:天津自考 串讲笔记 北大“接口技术”上机类型题目及答案(3)
转载请注明:文章转载自(http://www.zikaotj.com)
《天津自考网》免责声明:
1、由于各方面情况的调整与变化,本网提供的考试信息仅供参考,考试信息以省考试院及院校官方发布的信息为准。
2、本网信息来源为其他媒体的稿件转载,免费转载出于非商业性学习目的,版权归原作者所有,如有内容与版权问题等请与本站联系。联系邮箱:812379481@qq.com。