11.07.2015 Views

section 7 - Index of

section 7 - Index of

section 7 - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ILLEGAL INSTRUCTION INTERRUPTRECOGNIZED AS PENDINGINTERRUPT CONTROL CYCLE 1INTERRUPT CONTROL CYCLE 2FETCH n1 n2 n3 n4 n5 n6 n7 - - - ii1 ii2 n8DECODE n1 n2 n3 n4 REP I - - - - ii1 ii2 n8EXECUTEINSTRUCTION CYCLE COUNT 1 2INTERRUPTINTERRUPT INSTRUCTION WORDILLEGAL INSTRUCTIONn = NORMAL INSTRUCTION WORDn1n23 4 5n3 n4 REP REP t\OP6 7 8 9 10Figure 7-6 Repeated Illegal Instructionii- - - ii1 ii2 n811 12 13 14 15 16There are two cases in which the stacked address will not point to the illegal instruction:1. If the illegal instruction is one <strong>of</strong> the two instructions at an interrupt vector locationand is fetched during a regular interrupt service, the processor will stackthe address <strong>of</strong> the next sequential instruction in the normal instruction flow (theregular return address <strong>of</strong> the interrupt routine that had the illegal opcode in itsvector).2. If the illegal instruction follows an REP instruction (see Figure 7-6), the processorwill effectively execute the illegal instruction as a repeated NOP and theinterrupt vector will then be inserted in the pipeline. The next instruction will befetched but will not be decoded or executed. The processor will stack theaddress <strong>of</strong> the next sequential instruction, which is two instructions after theillegal instruction.In DO loops, if the illegal instruction is in the loop address (LA) location and the instructionpreceding it (Le., at LA-1) is being interrupted, the loop counter (LC) will be decrementedas if the loop had reached the LA instruction. When the interrupt service endsand the instruction flow returns to the lOOp, the illegal instruction will be refetched (since itis the next sequential instruction in the flow). The loop state machine will again decrementLC because the LA instruction is being executed. At this point, the illegal instructionwill trigger the III. The result is that the loop state machine decrements LC twice in oneloop due to the presence <strong>of</strong> the illegal opcode at the LA location.

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

Saved successfully!

Ooh no, something went wrong!