下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
Chapter12
InterruptsInstructor:Dr.YuYoulingContentBasicInterruptProcessingHardwareInterruptsExpandingtheInterruptStructure8259AProgrammableInterruptControllerExamples2023/1/17第2頁(yè)InterruptsInterruptprocessingisanalternativetopolling.TheIntelmicroprocessorssupporthardwareinterruptsthrough:Twopinsthatallowinterruptrequests,INTRandNMIOnepinthatacknowledges,INTA,theinterruptrequestedonINTR.Andsoftwareinterruptsthroughinstructions:INT,INTO,INT3,BOUNDControlisprovidedthroughIFandTFflagbitsIRETandIRETD2023/1/17第3頁(yè)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頁(yè)InterruptVectorTableTheinterruptvectortableislocatedinthefirst1024bytesofmemoryataddresses00000Hthrough003FFH.Thereare2564-byteentries(segmentandoffsetinrealmode).2023/1/17第5頁(yè)RealModeInterruptsAftertheexecutionofeachinstruction,themicroprocessordetermineswhetheraninterruptisactivebychecking,inorder:Single-stepNMICoprocessorsegmentoverrunINTRINTIfoneormoreoftheseconditionsarepresent,then:FLAGSispushedontothestackBoththeinterrupt(IF)andtrap(TF)flagsarecleared,whichdisablestheINTRpinandthetraporsingle-stepfeature.TheCSandIParepushedontothestack.TheinterruptvectorcontentsarefetchedandloadedintoCSandIPandexecutionresumesintheISR.OnIRET,CS,IPandFLAGSarepopped.2023/1/17第6頁(yè)RealandProtectedModeInterruptsThereturnaddress(CS/IP)ispushedontothestackduringtheinterrupt.Thereturnaddresscanpointto:Thenextinstruction.Theoffending(current)instruction.Thismakesitpossibletotrytheinstructionagain.2023/1/17第7頁(yè)HardwareInterruptsTheINTRpinmustbeexternallydecodedtoselectavector.Anyvectorispossible,buttheinterruptvectorsbetween20HandFFHareusuallyused(Intelreservesvectorsbetween00Hand1FH).INTAisanoutputofthemicroprocessortosignaltheexternaldecodertoplacetheinterruptnumberondatabusconnectionsD7-D0.TheINTRpinissetbyanexternaldevice(8259A)andclearedintheISR.Theinputisautomaticallydisabledbythemicroprocessoronceitisrecognizedandre-enabledbyIRETorIRETDinstruction.Timingdiagramofthehandshake.2023/1/17第8頁(yè)HardwareInterruptsSimpliestmethodofgeneratinganinterruptvector:2023/1/17第9頁(yè)Tri-stateBufferforGeneratingtheInterruptVector2023/1/17第10頁(yè)Handlingmorethan1IRQIfanyofIRQxgoeslow,theNANDoutputgoeshighrequestinganinterrupt.NotethatifmorethanoneIRQgoeslow,auniqueinterruptvectorisgeneratedandaninterruptpriorityneedstobedefined.TheInterruptVectortablemustbeexpandedtomodatethis.2023/1/17第11頁(yè)Example2023/1/17第12頁(yè)2023/1/17第13頁(yè)Instruction2023/1/17第14頁(yè)ExternalHardwareInterruptsExternalhardwareinterruptinterfacecircuitry-ResponsiblefordeterminingwhichofanypendinginterruptshashighestpriorityINTR:InterruptrequestLevel-triggered–“1”mustbemaintaineduntilINTA.Mustgobackto“0”beforeserviceroutineisdone.INTA:InterruptacknowledgeTwopulses...theCPUissaying:PULSE1:“Gotit–nowsendthetypenumber”PULSE2:“PlacetheTypenumberondatabus”2023/1/17第15頁(yè)Read/WriteInterruptVectorTable設(shè)置中斷向量把由AL指定的中斷類型的中斷向量DS:DX放置在中斷向量表的相應(yīng)位置中。 AH=25H執(zhí)行:INT21H AL=中斷類型號(hào) DS:DX=中斷向量取中斷向量把由AL指定的中斷類型的中斷向量從中斷向量表中取到ES:BX中
預(yù)置:AH=35H執(zhí)行:INT21H AL=中斷類型號(hào)
返回:ES:BX=中斷向量2023/1/17第16頁(yè)ExampleMOVAL,N;typeNInterruptMOVAH,35H;getInterruptvectorINT21H;PUSHES; savetheoldbaseandPUSHBX;offsetofinterruptNPUSHDS;MOVAX,SEGINTHAND;MOVDS,AX;baseofINTHANDinDSMOVDX,OffsetINTHAND;offsetinDXMOVAL,N;MOVAH,25H;SetInterruptVectorINT21H;2023/1/17第17頁(yè)P(yáng)OPDS;…POPDX; restoretheoldoffsetPOPDS; andbaseofinterruptMOVAL,N;MOVAH,25H;setinterruptvectorINT21H;RET;returnINTHAND:….InterruptProcessingRoutineIRET例:使用DOS功能調(diào)用存取中斷向量TypicalArchitecture2023/1/17第18頁(yè)The8259Aadds8vectoredpriorityencodedinterruptstothemicroprocessor.Itcanbeexpandedto64interruptrequestsbyusingonemaster8259Aand8slaveunits.8259AProgrammableInterruptController2023/1/17第19頁(yè)8259AProgrammableInterruptControllerINTConnectstotheINTRpinonthemicroprocessor.INTAConnectstotheINTApinonthemicroprocessor.A0Selectsdifferentcommandwordsinthe8259A.SP/ENSlaveProgram(1formaster,0forslave)/EnableBuffer(controlsthedatabustransceiverswheninbufferedmode).CAS2-CAS0Usedasoutputsfromthemastertotheslavesincascadedsystems.2023/1/17第20頁(yè)8259AProgrammableInterruptControllerAsingle8259Aconnectedinthe8086.2023/1/17第21頁(yè)P(yáng)rogrammingthe8259AProgrammedbyInitialization(ICWs)andOperation(OCWs)CommandWords.Thereare4ICWs.Atpower-up,ICW1,ICW2andICW4mustbesent.IfICW1indicatescascademode,thenICW3mustalsobesent.ICW1:LTIMindicatesifIRQlinesarepositiveedge-triggeredorlevel-triggered.2023/1/17第22頁(yè)ICW2:ThesebitsdeterminethevectornumbersusedwiththeIRQinputs.Forexample,ifprogrammedtogeneratevectors08H-0FH,08Hisplacedintothesebitpositions.ICW3:Programmingthe8259A2023/1/17第23頁(yè)P(yáng)rogrammingthe8259AICW4:Fullynestedmodeallowsthehighest-priorityinterruptrequestfromaslavetoberecognizedbythemasterwhileitisprocessinganotherinterruptfromaslave.AEOI,if1,indicatesthataninterruptautomaticallyresetstheinterruptrequestbit,otherwiseOCW2isconsultedforEOIprocessing.2023/1/17第24頁(yè)InitializationFlow2023/1/17第25頁(yè)P(yáng)rogrammingthe8259ATheOperationCommandWords(OCWs)areusedtodirecttheoperationofthe8259A.OCW1:OCW1isusedtoreadorsettheinterruptmaskregister.Ifabitisset,itwillturnoff(mask)thecorrespondinginterruptinput.OCW2:OnlyprogrammedwhentheAEOImodeinICW4is0.Allowsyoutocontrolprioritiesaftereachinterruptisprocessed.2023/1/17第26頁(yè)P(yáng)rogrammingthe8259AOCW2Non-specificEOI:Here,theISRsetsthisbittoindicateEOI.The8259Aautomaticallydetermineswhichinterruptwasactiveandre-enablesitandlowerpriorityinterrupts.SpecificEOI:ISRresetsaspecificinterruptrequestgivenbyL2-L0.Rotatecommandscauseprioritytoberotatedw.r.t.thecurrentonebeingprocessed.Setpriority:allowsthesettingofthelowestpriorityinterrupt(L2-L0).2023/1/17第27頁(yè)P(yáng)rogrammingthe8259AOCW3Ifpollingisset,thenextreadoperationwillreadthepollword.Iftheleftmostbitissetinthepollword,therightmost3bitsindicatetheactiveinterruptrequestwithhighestpriority.AllowsISRtoservicehighestpriorityinterrupt.Therearethreestatusregisters,InterruptRequestRegister(IRR),In-ServiceRegister(ISR)andInterruptMaskRegister(IMR).IRR:Indicateswhichinterruptrequestlinesareactive.ISR:Leveloftheinterruptbeingserviced.IMR:Amaskthatindicateswhichinterruptsareon/off.2023/1/1
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025福建漳州漳州市龍文區(qū)碧湖街道社區(qū)衛(wèi)生服務(wù)中心招聘工作人員1人工作參考考試題庫(kù)及答案解析
- 2026年國(guó)際數(shù)字貨幣監(jiān)管咨詢合同
- 2026云南普洱“才聚普洱?智贏未來(lái)”-鎮(zhèn)沅縣衛(wèi)生健康行業(yè)急需緊缺人才招聘14人備考考試題庫(kù)及答案解析
- 2025福建廈門清大海峽私募基金管理有限公司人員招聘1人考試筆試模擬試題及答案解析
- 贛州市人力資源有限公司招聘勞務(wù)外派工作人員備考考試題庫(kù)及答案解析
- 北京經(jīng)濟(jì)技術(shù)開(kāi)發(fā)區(qū)教育領(lǐng)域面向應(yīng)屆畢業(yè)生招聘聘任制教師129人備考考試試題及答案解析
- 2025廣西崇左市扶綏縣龍頭鄉(xiāng)衛(wèi)生院招聘8人參考筆試題庫(kù)及答案解析
- 試劑硫酸生產(chǎn)線建設(shè)項(xiàng)目節(jié)能評(píng)估報(bào)告
- 管道系統(tǒng)應(yīng)急響應(yīng)團(tuán)隊(duì)建設(shè)
- 2025福建省永泰產(chǎn)業(yè)投資集團(tuán)有限公司招聘7人備考考試題庫(kù)及答案解析
- GB/T 28734-2012固體生物質(zhì)燃料中碳?xì)錅y(cè)定方法
- GB/T 23280-2009開(kāi)式壓力機(jī)精度
- 智慧樹(shù)創(chuàng)意學(xué)經(jīng)濟(jì)測(cè)試題答案
- 《我的心兒怦怦跳》優(yōu)秀課件
- 包裝印刷包裝設(shè)計(jì)及及規(guī)范
- 金壇區(qū)蘇教版六年級(jí)上冊(cè)數(shù)學(xué)第6單元《百分?jǐn)?shù)》教材分析(定稿)
- 畢業(yè)論文-基于單片機(jī)的太陽(yáng)能充電寶設(shè)計(jì)
- 申請(qǐng)簽證證件的證明(擔(dān)保)函件
- (研究生)高級(jí)管理會(huì)計(jì)理論與實(shí)務(wù)ppt教學(xué)課件(完整版)
- 《西游記》中女妖形象探析新譚素梅
- 監(jiān)控中心裝修施工方案設(shè)計(jì)
評(píng)論
0/150
提交評(píng)論