资源描述:
《微机原理 8259程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、assumecs:codecodesegmentpublicorg100hstart:movcx,0start1:climovdx,04a0hmovax,13houtdx,ax;ICW1,ICW4NEEDEDmovdx,04a2hmovax,80houtdx,ax;ICW2中断类型80hvhmovax,01h;01outdx,ax;ICW4movax,00houtdx,ax;OCW1,开放所有中断nop;以上为8259初始化movax,0movds,axmovdi,200h;初始化中断向量表mo
2、vax,offsetint0movds:[di],axadddi,2movds:[di],100hadddi,2movax,offsetint1movds:[di],axadddi,2movds:[di],100hadddi,2movax,offsetint2movds:[di],axadddi,2movds:[di],100hadddi,2movax,offsetint3movds:[di],axadddi,2movds:[di],100hadddi,2movax,offsetint4movd
3、s:[di],axadddi,2movds:[di],100hadddi,2movax,offsetint5movds:[di],axadddi,2movds:[di],100hadddi,2movax,offsetint6movds:[di],axadddi,2movds:[di],100hadddi,2movax,offsetint7movds:[di],axadddi,2;上述程序为芯片8259的初始化程序movds:[di],100h;建议不熟练者不要修改。main:movax,0sti
4、;开中断。waiting:cmpax,0hjewaiting;没发生中断,则等待movdx,04b0houtdx,ax;对应LED灯亮movcx,0delay1:loopdelay1;数字滤波,按键去抖jmpstart1int0:cli;关中断。以下类推。nop;此两行为IR0的中断服务程序movax,0feh;用户可修改。iret;中断返回,以下类推。int1:clinop;此两行为IR1的中断服务程序,movax,0fdh;用户可修改。iretint2:clinop;此两行为IR2的中断服务
5、程序,movax,0fbh;用户可修改。iretint3:clinop;此两行为IR3的中断服务程序,movax,0f7h;用户可修改。iretint4:clinop;此两行为IR4的中断服务程序,movax,0efh;用户可修改。iretint5:clinop;此两行为IR5的中断服务程序,movax,0dfh;用户可修改。iretint6:clinop;此两行为IR6的中断服务程序,movax,0bfh;用户可修改。iretint7:clinop;此两行为IR7的中断服务程序,movax,0
6、7fh;用户可修改。iretcodeendsendstart