17.05.2015 Views

16-Bit Microprocessor Handbook

16-Bit Microprocessor Handbook

16-Bit Microprocessor Handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

o cycusi<br />

®<br />

I--- > 11 +'e ~ 8 +'e CYCUS1<br />

o<br />

..J<br />

W<br />

~<br />

~DRIVENLOWEXTERNALLY .,- ~U NHALT<br />

I<br />

I<br />

~ ~<br />

DRIVEN HIGH EXTERNALLY<br />

(OR USING INTERNAL PULLUP)<br />

5 CLOCK CYCLE MIN.<br />

INTERRUPT RESP. TIME 0)<br />

So 15 + 21e CYCLES0 > 5 + 1e CYCLES<br />

.. __ J - J<br />

$. 3 CLK<br />

I<br />

CYCLES<br />

• ACK .•<br />

~<br />

APPROX.2 1/2+te0~<br />

~<br />

CLOCK CYC LES<br />

CONTINUE DRIVEN BY PACE<br />

CONTINUE<br />

I<br />

I -<br />

DRIVEN<br />

EXTERNALLY<br />

~ \ ~<br />

EXECUTION<br />

EXECUTION SUSPENDED<br />

- I -<br />

CONTINUE DRIVEN EXTERNALLY<br />

INTERRUPT SERVICE STARTS<br />

I<br />

- I -<br />

I<br />

I<br />

I<br />

CONT<br />

NOTES:<br />

1. EXTERNALLY GENERATED TTL INPUTS<br />

OVERRIDE PACE MOS OUTPUTS<br />

2. ~ CROSSHATCH INDICATES "DON'T<br />

~ CARF'INPUT STATE.<br />

3. te = DURATION OF EXTEND DURING PACE<br />

I/O CYCLES. TIMING ASSUMES NO OTHER<br />

EXTENDS AND NO SUSPENDS<br />

Figure 1-15. Initiating INS8900 and PACE Level 0 Interrupt<br />

Using NHALT and CONTIN Signals<br />

Remember that other levels of interrupts store the contents of the Program Counter or the Stack and reset the lEN flag<br />

in the Status and Control Flag register. This sequence obviously alters the "picture" of the CPU, since both Stack contents<br />

and Status and Control Flag register contents are changed. To avoid this, the Level 0 interrupt response by the<br />

CPU uses an external memory location to store the contents of the Program Counter. Memory location 0007<strong>16</strong> holds<br />

the address of the memory word where the Program Counter will be stored. The contents of the Status and Control Flag<br />

register are unaltered. CPU internal circuitry resets an "IRO INT ENABLE flag to prevent another interrupt from being<br />

recognized (refer to Figure 1-<strong>16</strong>). but this is not discernible to you. After the Program Counter has been saved in the<br />

designated memory location, the instruction contained in memory location 0008<strong>16</strong> is executed: this is the first instruction<br />

of your Level 0 interrupt service routine. Suppose, for example, that memory location 0007<strong>16</strong> contains the value<br />

FF00<strong>16</strong>. Following a Level 0 interrupt request. the Program Counter contents will be stored in location FFO0<strong>16</strong>. Following<br />

the Level 0 interrupt acknowledge, the actual instruction stored in memory location 0008<strong>16</strong> is executed.<br />

Note that the Level 0 interrupt acknowledge sequence has not altered anything within the CPU that is discernible to<br />

you or to a program: the Stack, Accumulators, and Status and Control Flag register are all unchanged. Additionally,<br />

avoiding use of the Stack ensures that there will not be a Stack overflow - and in consequence a Stack interrupt will<br />

not be generated by this interrupt response sequence.<br />

The normal Return-from-Interrupt (RTIl instruction that must be executed at the end of your inter- RETURN FROM<br />

rupt service routine causes the Program Counter to be restored from the Stack Since the Level 0 PACE LEVEL 0<br />

interrupt sequence does not utilize the Stack to store the Program Counter, a different tech- INTERRUPT<br />

nique must be used to return control to the interrupted program. First you must execute a Set<br />

Flag (SFLG) or Pulse Flag (PFLG) instruction, referencing bit 15 in the Status and Control Flag register. This bit always<br />

appears to be set to a '1', but must be referenced in this case to enable lower levels of interrupts. Next you must ex-<br />

1-23

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

Saved successfully!

Ooh no, something went wrong!