北大自考微机接口上机(附答案)

上传人:第*** 文档编号:34094712 上传时间:2018-02-20 格式:DOC 页数:10 大小:72KB
返回 下载 相关 举报
北大自考微机接口上机(附答案)_第1页
第1页 / 共10页
北大自考微机接口上机(附答案)_第2页
第2页 / 共10页
北大自考微机接口上机(附答案)_第3页
第3页 / 共10页
北大自考微机接口上机(附答案)_第4页
第4页 / 共10页
北大自考微机接口上机(附答案)_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《北大自考微机接口上机(附答案)》由会员分享,可在线阅读,更多相关《北大自考微机接口上机(附答案)(10页珍藏版)》请在金锄头文库上搜索。

1、1. 从键盘上输入 09,通过 8255 方式 0,A 口输出,输出在数码管上显示相应数字(即我在键盘上输入 5,则在数码管上显示 5) 。data segmentnum1 db please input a number(0-9):,0dh,0ah,$led db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fhdata endscode segmentassume cs:code,ds:datastart: mov ax,datamov ds,axmov dx,28bhmov al,80hout dx,all1: call crlflea dx,num1mov

2、 ah,09hint 21hmov ah,01hint 21hcmp al,0jb exitcmp al,9ja exitsub al,30hlea bx,ledxlat mov dx,288hout dx,aljmp l1exit: mov ah,4chint 21hcrlf proc nearmov dl,0dhmov ah,02hint 21hmov dl,0ahmov ah,02hint 21hretcrlf endpcode endsend start2 8255 方式 0,A 口输入,输入的数高 4 位不变低 4 位取反,在 8255 的 C 口输出,有键按下返回 DOS,无键按下

3、继续执行。code segmentassume cs:codestart: mov dx,28bhmov al,90hout dx,all1: mov dx,288hin al,dxxor al,0fhmov dx,28ahout dx,almov ah,1int 16hjz l1mov ah,4chint 21hcode endsend start38255 方式 0,C 口低 4 位输入数据取反,在 8255 的 C 口高 4 位输出,有键按下返回DOS,无键按下继续执行。code segmentassume cs:codestart: mov dx,28bhmov al,81hout d

4、x,all1: mov dx,28ahin al,dxmov cl,4shl al,clxor al,0f0hmov dx,28ahout dx,almov ah,1int 16hjz l1mov ah,4chint 21hcode ends48255 方式 0,A 口输入, C 口输出。如果 A 口输入的数大于等于 128,从 C 口输出 80H;否则将输入的数高 4 位不变低 4 位取反从 C 口输出,有键按下返回 DOS,无键按下继续执行。code segmentassume cs:codestart: mov dx,28bhmov al,90hout dx,all3: mov dx,2

5、88hin al,dxcmp al,80hjae l1xor al,0fhmov dx,28ahout dx,all2: mov ah,1int 16hjz l3mov ah,4chint 21hl1: mov al,80hmov dx,28ahout dx,aljmp l2code endsend start58255 方式 0,A 口输入 C 口输出,如果 A 口的 PA7 输入为 0,则 L5、L2 灯亮,PA7 为 1,则 L7、L0 灯亮,有键按下返回 DOS,无键按下继续执行。code segmentassume cs:codestart: mov dx,28bhmov al,90

6、hout dx,all3: mov dx,288hin al,dxtest al,80hjz l1mov al,81hmov dx,28ahout dx,all2: mov ah,1int 16hjz l3mov ah,4chint 21hl1: mov dx,28ahmov al,24hout dx,aljmp l2code endsend start6 8255 方式 0,A 口输出 C 口输入,C 口输入高 2 为位取反低 6 位不变,用键盘控制程序,有键按下返回 DOS,无键按下程序继续执行code segmentassume cs:codestart: mov dx,28bhmov

7、al,89hout dx,all1: mov dx,28ahin al,dxxor al,0c0hmov dx,288hout dx,almov ah,1int 16hjz l1mov ah,4chint 21hcode endsend start7 8255 方式 0,A 口输出到 LED 灯上,让灯按顺序从左到右移动显示,每显示一个灯延时一秒在显示下一个灯,有键按下返回 DOS,无键按下继续执行。code segmentassume cs:codestart: mov dx,28bhmov al,80hout dx,almov dx,288hmov al,01hl1: out dx,alc

8、all timerol al,1mov ah,1int 16hjz l1mov ah,4chint 21htime proc nearpush cxmov si,0200ht2: mov cx,0t1: loop t1 dec sijnz t2pop cxrettime endpcode endsend start88255 方式 0,C 口输入 0Fh,A 口输出在数码管上显示和计算机显示器显示相应数 , 有键按下返回 DOS,无键按下继续执行。data segmentled db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,67h,77h,7ch,39h,5eh

9、,79h,71hdata endscode segmentassume cs:code,ds:datastart: mov dx.,28bhmov al,89hout dx,allea bx,ledl1: mov dx,28ahin al,dxand al,0fhcall dispxlatmov dx,288hout dx,almov ah,1int 16hjz l1mov ah,4chint 21hdisp proc nearpush ush axmov dl,alcmp dl,0ahjb d1add dl,7d1: add dl,30hmov ah,02int 21hmov dl,0dhi

10、nt 21hmov dl,0ah int 21hpop axpop dxdisp endpcode ends end start98255 方式 0,C 口输入 0Fh,A 口输出在数码管上显示对应数,计算机显示器显示该数加 1, 有键按下返回 DOS,无键按下继续执行。 (在计算机显示器上即输入 0 显示 1,输入F 时显示 G) 。data segmentled db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,67h,77h,7ch,39h,5eh,79h,71hdata endscode segmentassume cs:code,ds:datastart:

11、 mov dx.,28bhmov al,89hout dx,allea bx,ledl1: mov dx,28ahin al,dxand al,0fhcall dispxlatmov dx,288hout dx,almov ah,1int 16hjz l1mov ah,4chint 21hdisp proc nearpush ush axadd al,1mov dl,alcmp dl,0ahjb d1add dl,7d1: add dl,30hmov ah,02int 21hmov dl,0dhint 21h mov dl,0ahint 21hpop axpop dxdisp endpcode

12、 ends end start108253 通道 0 方式 0,计数值为 0Fh,手动逐个输入脉冲,从计算机显示器上显示对应的数。code segmentassume cs:codestart: mov dx,283hmov al,10hout dx,almov dx,280hmov al,0fhout dx,all1: mov dx,280hin al,dxcall dispmov ah,1int 16hjz l1mov ah,4chint 21hdisp proc nearpush dxand al,0fhmov dl,alcmp dl,9jbe numadd dl,7num: add dl,30hmov ah,02hint 21hmov dl,0dhint 21hmov dl,0ahint 21hpop dx retdisp endp code ends end start118253 通道 0 方式 0,从 8255C 口读入计数值,手动逐个输入脉冲,从 A 口输出在数码管显示其值。code segmentassume cs:codestart: mov dx,28bhmov al,88hout d

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号