Beruflich Dokumente
Kultur Dokumente
INTERRUPTS
THEORY
Interrupt (INT):
There are three types of interrupts. Namely:
Hardware Interrupt:
Lets see the two ways where we get hardware interrupts, namely
1. NMI
2. INTR
If NMI line receives an INT, microprocessor executes INT2.
If INTR line receives an INT, MP executes two INTA pulses:
During the 1st INTA: the interrupting device calculates the vector number.
During the 2nd INTA: the interrupting device sends the vector number N to the
microprocessor.
Handling hardware interrupt:
If IF (INT FLAG) =0, then INT is masked (masked means not taken).
If IF (INT FLAG) =1, then INT is unmasked.
Software Interrupt:
Here when this type of interrupt comes, following steps are followed by the
microprocessor:
Decrease SP (stack pointer) by 2 and push flag registers on stack.
Disable INT input by clearing IF in the flag register.
Reset the TF (trap flag) in flag register.
Decrease SP by 2 and push current CS (code section) register content on stack.
Decrease SP by 2 and push current IP (instruction pointer) register content on
stack.
Jump to new address of the ISR (Interrupt service routine) by getting new value
of CS and IP from IVT (interrupt vector table).
8086 will execute ISR.
An IRET at the end of an ISR return executes to main program.
8086 will restore IP & CS register content from stack.
8086 will also restore flag register from the stack.
1
INTRODUCTION TO 8086
INTERRUPTS
THEORY
Clear IF
Clear TF
PUSH CS
PUSH IP
FETCH ISR
Address
HLT
IRET
POP IP
POP CS
POP FLAGS
ISR
IRET
INTRODUCTION TO 8086
INTERRUPTS
THEORY
INT1
INTRODUCTION TO 8086
INTERRUPTS
INT2
INT3
INT4
THEORY
INT5 INT31
Reserved interrupts.
Reserved by INTEL for higher processors.
INT32 INT255
User defined interrupts.
Interrupt written by user to service various user defined conditions.
Interrupts are invoked by writing INTn.