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

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

ID:1248752

大小:72.00 KB

页数:10页

时间:2017-11-09

北大自考微机接口上机(附答案)_第1页
北大自考微机接口上机(附答案)_第2页
北大自考微机接口上机(附答案)_第3页
北大自考微机接口上机(附答案)_第4页
北大自考微机接口上机(附答案)_第5页
资源描述:

《北大自考微机接口上机(附答案)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、1.从键盘上输入0~9,通过8255方式0,A口输出,输出在数码管上显示相应数字(即我在键盘上输入5,则在数码管上显示5)。datasegmentnum1db'pleaseinputanumber(0-9):',0dh,0ah,'$'leddb3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fhdataendscodesegmentassumecs:code,ds:datastart:movax,datamovds,axmovdx,28bhmoval,80houtdx,all1:callcrlfleadx,num1movah,09hint21hmovah,01hint

2、21hcmpal,'0'jbexitcmpal,'9'jaexitsubal,30hleabx,ledxlatmovdx,288houtdx,aljmpl1exit:movah,4chint21hcrlfprocnearmovdl,0dhmovah,02hint21hmovdl,0ahmovah,02hint21hretcrlfendpcodeendsendstart2.8255方式0,A口输入,输入的数高4位不变低4位取反,在8255的C口输出,有键按下返回DOS,无键按下继续执行。codesegmentassumecs:codestart:movdx,28bhmoval,90houtdx,

3、all1:movdx,288hinal,dxxoral,0fhmovdx,28ahoutdx,almovah,1int16hjzl1movah,4chint21hcodeendsendstart3.8255方式0,C口低4位输入数据取反,在8255的C口高4位输出,有键按下返回DOS,无键按下继续执行。codesegmentassumecs:codestart:movdx,28bhmoval,81houtdx,all1:movdx,28ahinal,dxmovcl,4shlal,clxoral,0f0hmovdx,28ahoutdx,almovah,1int16hjzl1movah,4chin

4、t21hcodeends4.8255方式0,A口输入,C口输出。如果A口输入的数大于等于128,从C口输出80H;否则将输入的数高4位不变低4位取反从C口输出,有键按下返回DOS,无键按下继续执行。codesegmentassumecs:codestart:movdx,28bhmoval,90houtdx,all3:movdx,288hinal,dxcmpal,80hjael1xoral,0fhmovdx,28ahoutdx,all2:movah,1int16hjzl3movah,4chint21hl1:moval,80hmovdx,28ahoutdx,aljmpl2codeendsendst

5、art5.8255方式0,A口输入C口输出,如果A口的PA7输入为0,则L5、L2灯亮,PA7为1,则L7、L0灯亮,有键按下返回DOS,无键按下继续执行。codesegmentassumecs:codestart:movdx,28bhmoval,90houtdx,all3:movdx,288hinal,dxtestal,80hjzl1moval,81hmovdx,28ahoutdx,all2:movah,1int16hjzl3movah,4chint21hl1:movdx,28ahmoval,24houtdx,aljmpl2codeendsendstart6.8255方式0,A口输出C口输入

6、,C口输入高2为位取反低6位不变,用键盘控制程序,有键按下返回DOS,无键按下程序继续执行codesegmentassumecs:codestart:movdx,28bhmoval,89houtdx,all1:movdx,28ahinal,dxxoral,0c0hmovdx,288houtdx,almovah,1int16hjzl1movah,4chint21hcodeendsendstart7.8255方式0,A口输出到LED灯上,让灯按顺序从左到右移动显示,每显示一个灯延时一秒在显示下一个灯,有键按下返回DOS,无键按下继续执行。codesegmentassumecs:codestart:

7、movdx,28bhmoval,80houtdx,almovdx,288hmoval,01hl1:outdx,alcalltimerolal,1movah,1int16hjzl1movah,4chint21htimeprocnearpushcxmovsi,0200ht2:movcx,0t1:loopt1decsijnzt2popcxrettimeendpcodeendsendstart8.8255

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。