版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Chapter12
InterruptsInstructor:Dr.YuYoulingContentBasicInterruptProcessingHardwareInterruptsExpandingtheInterruptStructure8259AProgrammableInterruptControllerExamples2023/1/17第2页InterruptsInterruptprocessingisanalternativetopolling.TheIntelmicroprocessorssupporthardwareinterruptsthrough:Twopinsthatallowinterruptrequests,INTRandNMIOnepinthatacknowledges,INTA,theinterruptrequestedonINTR.Andsoftwareinterruptsthroughinstructions:INT,INTO,INT3,BOUNDControlisprovidedthroughIFandTFflagbitsIRETandIRETD2023/1/17第3页InterruptVectorTableINTandINT3behaveinasimilarway.INTn:CallsISRlocatedatvectorn(n*4).TheINTinstructionrequirestwobytesofmemory,opcodeplusn.BOUNDandINTOarebothconditional.BOUND: BOUNDAX,DATAparesAXwithDATAAXiscomparedwithDATAandDATA+1,iflessthananinterruptoccurs.AXiscomparedwithDATA+2andDATA+3,ifgreaterthananinterruptoccurs.INTO:Checkstheoverflowflag(OF).IfOF=1,theISRiscalled.IRETremoves6bytesfromthestack,2forIP,2forCSand2forFLAGS.2023/1/17第4页InterruptVectorTableTheinterruptvectortableislocatedinthefirst1024bytesofmemoryataddresses00000Hthrough003FFH.Thereare2564-byteentries(segmentandoffsetinrealmode).2023/1/17第5页RealModeInterruptsAftertheexecutionofeachinstruction,themicroprocessordetermineswhetheraninterruptisactivebychecking,inorder:Single-stepNMICoprocessorsegmentoverrunINTRINTIfoneormoreoftheseconditionsarepresent,then:FLAGSispushedontothestackBoththeinterrupt(IF)andtrap(TF)flagsarecleared,whichdisablestheINTRpinandthetraporsingle-stepfeature.TheCSandIParepushedontothestack.TheinterruptvectorcontentsarefetchedandloadedintoCSandIPandexecutionresumesintheISR.OnIRET,CS,IPandFLAGSarepopped.2023/1/17第6页RealandProtectedModeInterruptsThereturnaddress(CS/IP)ispushedontothestackduringtheinterrupt.Thereturnaddresscanpointto:Thenextinstruction.Theoffending(current)instruction.Thismakesitpossibletotrytheinstructionagain.2023/1/17第7页HardwareInterruptsTheINTRpinmustbeexternallydecodedtoselectavector.Anyvectorispossible,buttheinterruptvectorsbetween20HandFFHareusuallyused(Intelreservesvectorsbetween00Hand1FH).INTAisanoutputofthemicroprocessortosignaltheexternaldecodertoplacetheinterruptnumberondatabusconnectionsD7-D0.TheINTRpinissetbyanexternaldevice(8259A)andclearedintheISR.Theinputisautomaticallydisabledbythemicroprocessoronceitisrecognizedandre-enabledbyIRETorIRETDinstruction.Timingdiagramofthehandshake.2023/1/17第8页HardwareInterruptsSimpliestmethodofgeneratinganinterruptvector:2023/1/17第9页Tri-stateBufferforGeneratingtheInterruptVector2023/1/17第10页Handlingmorethan1IRQIfanyofIRQxgoeslow,theNANDoutputgoeshighrequestinganinterrupt.NotethatifmorethanoneIRQgoeslow,auniqueinterruptvectorisgeneratedandaninterruptpriorityneedstobedefined.TheInterruptVectortablemustbeexpandedtomodatethis.2023/1/17第11页Example2023/1/17第12页2023/1/17第13页Instruction2023/1/17第14页ExternalHardwareInterruptsExternalhardwareinterruptinterfacecircuitry-ResponsiblefordeterminingwhichofanypendinginterruptshashighestpriorityINTR:InterruptrequestLevel-triggered–“1”mustbemaintaineduntilINTA.Mustgobackto“0”beforeserviceroutineisdone.INTA:InterruptacknowledgeTwopulses...theCPUissaying:PULSE1:“Gotit–nowsendthetypenumber”PULSE2:“PlacetheTypenumberondatabus”2023/1/17第15页Read/WriteInterruptVectorTable设置中断向量把由AL指定的中断类型的中断向量DS:DX放置在中断向量表的相应位置中。 AH=25H执行:INT21H AL=中断类型号 DS:DX=中断向量取中断向量把由AL指定的中断类型的中断向量从中断向量表中取到ES:BX中
预置:AH=35H执行:INT21H AL=中断类型号
返回:ES:BX=中断向量2023/1/17第16页ExampleMOVAL,N;typeNInterruptMOVAH,35H;getInterruptvectorINT21H;PUSHES; savetheoldbaseandPUSHBX;offsetofinterruptNPUSHDS;MOVAX,SEGINTHAND;MOVDS,AX;baseofINTHANDinDSMOVDX,OffsetINTHAND;offsetinDXMOVAL,N;MOVAH,25H;SetInterruptVectorINT21H;2023/1/17第17页POPDS;…POPDX; restoretheoldoffsetPOPDS; andbaseofinterruptMOVAL,N;MOVAH,25H;setinterruptvectorINT21H;RET;returnINTHAND:….InterruptProcessingRoutineIRET例:使用DOS功能调用存取中断向量TypicalArchitecture2023/1/17第18页The8259Aadds8vectoredpriorityencodedinterruptstothemicroprocessor.Itcanbeexpandedto64interruptrequestsbyusingonemaster8259Aand8slaveunits.8259AProgrammableInterruptController2023/1/17第19页8259AProgrammableInterruptControllerINTConnectstotheINTRpinonthemicroprocessor.INTAConnectstotheINTApinonthemicroprocessor.A0Selectsdifferentcommandwordsinthe8259A.SP/ENSlaveProgram(1formaster,0forslave)/EnableBuffer(controlsthedatabustransceiverswheninbufferedmode).CAS2-CAS0Usedasoutputsfromthemastertotheslavesincascadedsystems.2023/1/17第20页8259AProgrammableInterruptControllerAsingle8259Aconnectedinthe8086.2023/1/17第21页Programmingthe8259AProgrammedbyInitialization(ICWs)andOperation(OCWs)CommandWords.Thereare4ICWs.Atpower-up,ICW1,ICW2andICW4mustbesent.IfICW1indicatescascademode,thenICW3mustalsobesent.ICW1:LTIMindicatesifIRQlinesarepositiveedge-triggeredorlevel-triggered.2023/1/17第22页ICW2:ThesebitsdeterminethevectornumbersusedwiththeIRQinputs.Forexample,ifprogrammedtogeneratevectors08H-0FH,08Hisplacedintothesebitpositions.ICW3:Programmingthe8259A2023/1/17第23页Programmingthe8259AICW4:Fullynestedmodeallowsthehighest-priorityinterruptrequestfromaslavetoberecognizedbythemasterwhileitisprocessinganotherinterruptfromaslave.AEOI,if1,indicatesthataninterruptautomaticallyresetstheinterruptrequestbit,otherwiseOCW2isconsultedforEOIprocessing.2023/1/17第24页InitializationFlow2023/1/17第25页Programmingthe8259ATheOperationCommandWords(OCWs)areusedtodirecttheoperationofthe8259A.OCW1:OCW1isusedtoreadorsettheinterruptmaskregister.Ifabitisset,itwillturnoff(mask)thecorrespondinginterruptinput.OCW2:OnlyprogrammedwhentheAEOImodeinICW4is0.Allowsyoutocontrolprioritiesaftereachinterruptisprocessed.2023/1/17第26页Programmingthe8259AOCW2Non-specificEOI:Here,theISRsetsthisbittoindicateEOI.The8259Aautomaticallydetermineswhichinterruptwasactiveandre-enablesitandlowerpriorityinterrupts.SpecificEOI:ISRresetsaspecificinterruptrequestgivenbyL2-L0.Rotatecommandscauseprioritytoberotatedw.r.t.thecurrentonebeingprocessed.Setpriority:allowsthesettingofthelowestpriorityinterrupt(L2-L0).2023/1/17第27页Programmingthe8259AOCW3Ifpollingisset,thenextreadoperationwillreadthepollword.Iftheleftmostbitissetinthepollword,therightmost3bitsindicatetheactiveinterruptrequestwithhighestpriority.AllowsISRtoservicehighestpriorityinterrupt.Therearethreestatusregisters,InterruptRequestRegister(IRR),In-ServiceRegister(ISR)andInterruptMaskRegister(IMR).IRR:Indicateswhichinterruptrequestlinesareactive.ISR:Leveloftheinterruptbeingserviced.IMR:Amaskthatindicateswhichinterruptsareon/off.2023/1/1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 租赁买卖协议
- 按揭房产税务合规合同
- 订立保险契约居间合约
- 2024至2030年中国对甲氧基苯甲醇数据监测研究报告
- 2024至2030年中国双/单头中底定型机行业投资前景及策略咨询研究报告
- 外墙保温改造工程施工方案
- 能源供应业务协议
- 2024年中国生物波纳米抗菌健康袜市场调查研究报告
- 金融服务外包合同
- 一年级学生入队仪式领导发言稿
- 谈铁路企业安全文化建设
- 人教版六年级上册数学第一单元分数乘法应用题练习(含答案)
- 农机修理工考试农机修理中级工试卷(农机修理工考试)
- 美国人才引进的政策机制
- 热熔标线施工方案0
- 马工程版《中国经济史》各章思考题答题要点及详解
- 2023版思想道德与法治课件绪论担当复兴大任成就时代新人PPT
- 软件正版化培训
- Unit+2+Lesson+1+The+Underdog高中英语北师大版必修第一册+
- 腹腔镜根治性(扩大)左半结肠切除术-课件
- 胸腔闭式引流护理-2023年中华护理学会团体标准
评论
0/150
提交评论