Interrupts: RST 7.5 RST 6.5 RST 5.5 1 Non-Vectored Intr 1 Non-Maskable Vectored Trap
Interrupts: RST 7.5 RST 6.5 RST 5.5 1 Non-Vectored Intr 1 Non-Maskable Vectored Trap
Introduction
The interrupt I/O is a process of data transfer whereby an external device or a peripheral can
inform the processor that it is ready for communication and it requests attention.
The process is initiated by an external device and is asynchronous, meaning that it can be
initiated at any time without reference to the system clock. However, the response to an
interrupt request is directed or controlled by the microprocessor.
The interrupt requests are classified in two categories: maskable interrupt and nonmaskable
interrupt. More specifically four maskable interrupts and one nonmaskable interrupt. Among
these four maskable interrupts, one is nonvectored. The other three are vectored to specific
locations
RST 7.5
1 Non-
Vectored TRAP
maskable
If the flip-flop is enabled and the input to the interrupt signal INTR (pin 10) goes high, the
microprocessor is interrupted. This is a maskable interrupt and can be disabled.
DI (Disable Interrupt):
1-byte instruction.
Resets the Interrupt Enable flip-flop and disables the interrupt.
It should be included in a program segment where an interrupt from an outside source cannot
be tolerated.
Step 2: When the microprocessor is executing a program, it checks the INTR line during the
execution of each instruction.
Step 3: If the line INTR is high and the interrupt is enabled, the microprocessor:
• Completes the current instruction
• Disables the Interrupt Enable flip-flop
• Sends a signal called INTA - Interrupt Acknowledge (active low).
• The processor cannot accept any interrupt requests until the interrupt flip-flop is
enabled again.
Step 4: The signal INTA is used to insert a restart (RST) instruction through external hardware.
• The RST instruction is a 1-byte CALL instruction that transfers the program control to a
specific memory location on Page 00H (The first 256 bytes).
Step 6: Assuming that the task to be performed is written as a subroutine at the specified
location, the processor performs the task. This subroutine is known as a service routine
Step 7: The service routine should include the instruction EI to enable the interrupt again.
Step 8: At the end of the subroutine, the RET instruction retrieves the memory address where
the program was interrupted and continues the execution.
RST Instruction
The 8085 instruction set includes
eight RST (Restart) instructions:
• RST 0 , ………., RST 7
• These are 1-byte Call instructions
that transfer the program execution to
a specific location on page 00H, as
listed in the following Table.
Implementing the RST instruction (STEP 4)
To implement Step 4 in the interrupt process, insert one of these instructions in the
microprocessor by using external hardware and the signal INTA.
The microprocessor checks INTR, one clock period before the last T-state of an instruction cycle.
In the 8085, the Call instructions require 18 T-states; therefore, the INTR pulse should be high at
least for 17.5 T-states.
In a system with 3 MHz clock frequency the input pulse to INTR should be at least 5.8 µs long.
(1/3MHz *17.5)
3. Can the microprocessor be interrupted again before the completion of the first interrupt
service routine?
The answer to this question is determined by the programmer.
After the first interrupt, the interrupt process is automatically disabled.
If instruction El is written at the beginning of the routine, the microprocessor can be interrupted
gain during the service routine.
The following Figure shows how this circuit can be used with a Tri-
state buffer to implement an interrupt priority scheme.
Function Table for the priority encoder
When an interrupting
device requests service,
one of the input lines
goes low, which makes
line E0 high and
interrupts the
microprocessor
These last four (RSTs and TRAP) are automatically vectored (transferred) to specific locations
on memory page 00H without any external hardware.
They do not require the INTA signal or an input port; the necessary hardware is already
implemented inside the 8085.
TRAP
A nonmaskable interrupt that has the highest priority among the interrupt signals.
It need not be enabled, and it cannot be disabled.
As shown from this schema, all of the interrupts can be masked entirely by EI, or individually by
the SIM instruction and its code.
Triggering Mechanism
RST 7.5 Triggering Level
This is positive-edge sensitive and can be triggered with a short
pulse. The request is stored internally by the D flip-flop until
the microprocessor responds to the request or until it is
cleared by Reset or by bit D4 in the SIM instruction.
PENDING INTERRUPTS
Because there are several interrupt lines, when one interrupt request is being served, other
interrupt requests may occur and remain pending.
The 8085 has an additional instruction called RIM (Read Interrupt Mask) to sense these pending
interrupts.
Summary
Restart as a software instruction
After the breakpoint routine, the program should return to executing the main program at the
breakpoint.
The breakpoint procedure allows the user to test programs in segments.
For example, if RST 6 is written in a program, the program execution is transferred to location
0030H; it is equivalent to a 1-byte call instruction. This can be used to write a software
breakpoint routine.
Illustrative Program:
This code illustrates the use of a procedure to display the accumulator content and the PSW into
PORT1 and PORT2 when A is entered through a keyboard, and then returns when 0 is entered.
Here when an interrupt with an RST 6 code is initiated, this procedure is called. Arguably, this
could also be called from within a program as a normal instruction
SP’ X
So if at any at any point the programmer desires to view the content of the accumulator within
the program for debugging purposes, the user/programmer could inject RST 6 within the code.
Additional I/O Concepts and Processes
The 8085 interrupt I/O, described earlier, is limited because of its single interrupt pin and
hardware requirements to determine interrupt priorities.
To circumvent these limitations, a programmable interrupt controller such as the 8259A is used
to implement and extend the capability of the 8085 interrupt.
Another I/O process, Direct Memory Access (DMA), is commonly used for high-speed data
transfer.
• One of the major limitations of the 8085 interrupt scheme is that all requests are vectored to
memory locations on page 00H, which is reserved for ROM or EPROM,
• Access to these locations is difficult after a system has been designed.
• In addition, the process of determining priorities is limited, and extra hardware is required to
insert Restart instructions.
• The 8259A overcomes these limitations and provides many more flexible options.
• It can be employed with 16-bit Intel microprocessors as the 8086/8088 as well.