资源描述:
《综合实验(微机原理与接口技术).doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验五综合实验一、实验目的1.学习并掌握8259,8254,8255的工作方式及其应用;2.掌握应用电路的设计方法和接线。二、实验设备PC机一台,TD-PITE实验装置一套。三、实验内容1实验描述:同学们分组到实验室做实验,实验室共能容纳5组,三人一组,用数码管显示已进入实验室的组数,进入5组后在屏幕上显示OK。2接线图3实验源程序DATASEGMENTDTABLEDB3FH,06H,5BH,4FH,66HA8254EQU06C0HB8254EQU06C2HC8254EQU06C4HCON8254EQU06C6HA8255EQU0640HB8255EQU0642
2、HC8255EQU0644HCON8255EQU0646HDATAENDSSSTACKSEGMENTSTACKDW32DUP(?)SSTACKENDSCODESEGMENTASSUMECS:CODE,SS:SSTACK,DS:DATASTART:PUSHDSMOVAX,0000HMOVDS,AXMOVAX,OFFSETIRQ7;取中断入口地址MOVSI,003CH;中断矢量地址MOV[SI],AXMOVAX,CS;段地址MOVSI,003EHMOV[SI],AX;添IRQ7的段地址矢量CLIPOPDS;初始化主片8255MOVDX,CON8255MOVAL,80
3、HOUTDX,ALMOVDX,A8255MOVAL,0HOUTDX,AL;初始化主片8259MOVAL,11HOUT20H,AL;ICW1MOVAL,08HOUT21H,AL;ICW2MOVAL,04HOUT21H,AL;ICW3MOVAL,01HOUT21H,AL;ICW4MOVAL,6FH;OCW1OUT21H,AL;8254MOVDX,CON8254MOVAL,10H;计数器0,方式0OUTDX,ALMOVDX,A8254MOVAL,02HOUTDX,ALSTIMOVCX,5LEABX,DTABLEAA1:JMPAA1IRQ7:PUSHDXPUSHAXMO
4、VDX,A8254MOVAL,02HOUTDX,ALDECCXJZNEXTMOVDX,0640HMOVAL,[BX]OUTDX,ALINCBXNOPNOPMOVAL,20HOUT20H,ALPOPAXPOPDX;中断结束命令?IRETNEXT:MOVAX,014FHINT10HMOVAX,014BHINT10HPOPAXPOPDX;显示字符OKCODEENDSENDSTART5运行结果数码管显示相应的次数,5次数计满后在屏幕上显示OK