资源描述:
《硬件实验解答》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验4-8259中断实验STACKSEGMENTSTACKDW64DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,SS:STACKSTART:PUSHDS;保存数据段MOVAX,0000HMOVDS,AX;数据段清0MOVAX,OFFSETIRQ7;取中断程序入口地址(相对地址)ADDAX,2000H;加装载时IP=2000H地址(绝对地址)MOVSI,003CH;填8259中断7中断向量MOV[SI],AX;填偏移地址MOVAX,0000H;段地址CS=0000HMOVSI,003EHMOV[SI],AX;填段地址向量CLI;关中段POPDSINAL
2、,21H;读8259中断屏蔽字ANDAL,7FH;开8259中断7OUT21H,ALMOVCX,000AHA1:CMPCX,0000HJNZA2INAL,21HORAL,80HOUT21H,ALSTIHLTA2:STIJMPA1;断点IRQ7:MOVAX,0137H;中断程序入口地址INT10H;BIOS功能调用,MOVAX,0120H;显示“7”和空格INT10HDECCXMOVAL,20HOUT20H,ALCLIIRETCODEENDSENDSTART实验4-8259中断实验注意:程序中8259中断向量地址为绝对地址,已定义为段地址CS=0000H,偏移地址IP=2000H,故装
3、载时一定按此填入CS与IP地址.后面实验不再重述).分析程序·问题?·实验考试如果改变为IRQ3,或其它,程序应如何改动?实验5-8255并行接口应用实验(1)STACKSEGMENTSTACKDW64DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,SS:STACKSTART:MOVAL,83H;10000011OUT63H,ALA1:INAL,61HOUT60H,ALJMPA1CODEENDSENDSTART实验5-8255并行接口应用实验(2)STACKSEGMENTSTACKDW64DUP(?)STACKENDSCODESEGMENTASSUME
4、CS:CODESTART:CLI;关中断MOVAL,86H;控制字1000'0110OUT63H,ALMOVAL,05H;控制字00000101pc2置位,kk1下降沿触发OUT63H,ALMOVAX,0000HMOVDS,AXMOVAX,OFFSETIRQ7ADDAX,2000HMOVSI,003CHMOV[SI],AXMOVAX,0000HMOVSI,003EHMOV[SI],AXINAL,21HANDAL,7FHOUT21H,ALA1:STI;开中断HLTJMPA1IRQ7:INAL,61HOUT60H,ALMOVAL,20HOUT20H,ALIRETCODEENDSENDST
5、ARTSTACKSEGMENTSTACKDW256DUP(?)STACKENDSDATASEGMENTTABLEDB01H,03H,02H,06H,04H,0CH,08H,09HDATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMAIN:MOVAL,90HOUT63H,ALA1:MOVBX,OFFSETTABLEMOVCX,0008HA2:MOVAL,[BX]OUT61H,ALCALLDALLYINCBXLOOPA2JMPA1DALLY:PUSHCXMOVCX,5000HA3:PUSHAXPOPAXLOOP
6、A3POPCXRETCODEENDSENDSTART实验6-8253计数器应用实验设定8253的2#通道工作方式为方式0,用于事件计数,当计数值为5时,发出中断请求信号,显示“M”。实验部分程序如下:Stacksegmentstackdw64dup(?)StackendsCodesegmentassumess:code,ss:stackStart:inal,21handal,7fhout21h,alMOVAL,90HOUT43H,ALA1:MOVAL,05HOUT42H,ALhltstijmpa1movax,014dhint10hmovax,0120hint10hMoval,20ho
7、ut20h,aliretCodeendsendstart实验6-8253计数器应用实验(2)实验6-8253计数器应用实验(2)实验6-8253计数器应用实验(2)STACKSEGMENTSTACKDW64DUP(?)STACKENDSCODESEGMENTASSUMECS:CODESTART:PUSHDSMOVAX,0000HMOVDS,AXMOVAX,OFFSETIRQ0ADDAX,2000HMOVSI,0020HMOV[SI],AXMOVAX,000