section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

interrupts makes it very useful for setting breakpoints in monitor programs. The JSRinstruction does not affect the interrupt mask.The III is also a nonmaskable interrupt (IPL 3). It is serviced immediately following theexecution or the attempted execution of an illegal instruction (any undefined operationcode). Ills are fatal errors. Only a long interrupt routine should be used for the III routine.RTI or RTS should not be used at the end of the interrupt routine because, during the IIIservice, the JSR located in the III' vector will normally stack the address of the illegalinstruction (see Figure 7-4). Returning from the interrupt routine would cause the processorto attempt to execute the illegal interrupt again and cause an infinite loop which canonly be broken by cycling power. This long interrupt (see Figure 7-4) can be used as adiagnostic tool to allow the programmer to examine the stack (MOVE SSH, dest) andlocate the illegal instruction, or the application program can be restarted with the hopethat the failure was a soft error. The illegal instruction is useful for triggering the illegalinterrupt service routine to see if the III routine can recover from illegal instructions.-INTERRUPT CONTROL CYCLE 1INTERRUPT CONTROL CYCLE 2ii*i i*FETCH n3 n4DECODE n2 n3EXECUTE n1 n2INSTRUCTION BEING DECODED 1n5 ii1 ii3SWI - - -n3 SWI NOP NOPii4 sw1 sw2 sw3 sw4JSR - sw1 sw2 sw3NOP JSR - sw1 sw2i = INTERRUPT REQUESTi* = INTERRUPT REQUEST GENERATED BY SWIii1 = FIRST VECTOR OF INTERRUPT iii3 = FIRST SWI VECTOR (ONE-WORD JSR)ii4 = SECOND SWI VECTORn = NORMAL INSTRUCTION WORDn4 =SWIsw = INSTRUCTIONS PERTAINING TO THE SWI LONG INTERRUPT ROUTINEFigure 7-3 Interrupting an SWI

MAINPROGRAMFETCHESFAST INTERRUPTSERVICE ROUTINEFETCHESINFINITELOOP{II (NOP)1--__ "_6__--1NO FETCHNO FETCH(a) Instruction Fetches from MemoryILLEGAL INSTRUCTION INTERRUPTRECOGNIZED AS PENDINGILLEGAL INSTRUCTION INTERRUPTRECOGNIZED AS PENDINGINTERRUPT CONTROL CYCLE 1iINTERRUPT CONTROL CYCLE 2iFETCHDECODEEXECUTEINSTRUCTION CYCLE COUNT 1n1 n2 n3n1 n2n12 3 4n4 n5 n6 -n3 n4 II -rQ rG Ill- NJP5 6 7 8- ii1 ii2 n5- - i1 ii2 /I- - - ii1 ii2 I\Ol9 10 11 12 13 14iINTERRUPTii INTERRUPT INSTRUCTION WORDII = ILLEGAL INSTRUCTION" = NORMAL INSTRUCTION WORD(b) Program Controller PipelineFigure 7-4 Illegal Instruction Interrupt Serviced by a Fast Interrupt

MAINPROGRAMFETCHESFAST INTERRUPTSERVICE ROUTINEFETCHESINFINITELOOP{II (NOP)1--__ "_6__--1NO FETCHNO FETCH(a) Instruction Fetches from MemoryILLEGAL INSTRUCTION INTERRUPTRECOGNIZED AS PENDINGILLEGAL INSTRUCTION INTERRUPTRECOGNIZED AS PENDINGINTERRUPT CONTROL CYCLE 1iINTERRUPT CONTROL CYCLE 2iFETCHDECODEEXECUTEINSTRUCTION CYCLE COUNT 1n1 n2 n3n1 n2n12 3 4n4 n5 n6 -n3 n4 II -rQ rG Ill- NJP5 6 7 8- ii1 ii2 n5- - i1 ii2 /I- - - ii1 ii2 I\Ol9 10 11 12 13 14iINTERRUPTii INTERRUPT INSTRUCTION WORDII = ILLEGAL INSTRUCTION" = NORMAL INSTRUCTION WORD(b) Program Controller PipelineFigure 7-4 Illegal Instruction Interrupt Serviced by a Fast Interrupt

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!