Rohini 51792783171
Rohini 51792783171
The 8086 microprocessor has 256 types of interrupts. The type numbers are in the
range of 0 to 255. The 8086 processor has dual facility of initiating these 256 interrupts.
The interrupts can be initiated either by executing "INT n" instruction where n is the type
number or the interrupt can be initiated by sending an appropriate signal to INTR input
pin of the processor.
For the interrupts initiated by software instruction" INT n ", the type number is
specified by the instruction itself. When the interrupt is initiated through INTR pin, then
the processor runs an interrupt acknowledge cycle to get the type number. (i.e., the
interrupting device should supply the type number through D0- D7 lines when the
processor requests for the same through interrupt acknowledge cycle). The kinds of
interrupts and their designated types are summarized in the figure below, by illustrating
the layout of their pointers within the memory. Only the first five types have explicit
definitions; the other types may be used by interrupt instructions or external interrupts.
From the figure it is seen that the type associated with a division error interrupt is
0. Therefore, if a division by 0 is attempted, the processor will push the current contents
of the PSW, CS and IP into the stack, fill the IP and CS registers from the addresses
00000 to 00003, and continue executing at the address indicated by the new contents
of IP and CS. A division error interrupt occurs any time a DIV or IDIV instruction is
executed with the quotient exceeding the range, regardless of the IF (Interrupt flag) and
TF (Trap flag) status.
The type 1 interrupt is the single-step interrupt (Trap interrupt) and is the only
interrupt controlled by the TF flag. If the TF flag is enabled, then an interrupt will occur
at the end of the next instruction that will cause a branch to the location indicated by the
contents of 00004H to 00007H.The single step interrupt is used primarily for debugging
which gives the programmer a snapshot of his program after each instruction is executed
.
The type 2 interrupt is the nonmaskable external interrupt. It is the only external
interrupt that can occur regardless of the IF flag setting. It is caused by a signal sent to
the CPU through the nonmaskable interrupt pin.
The INTO instruction has type 4 and causes an interrupt if and only if the OF flag
is set to 1. It is often placed just after an arithmetic instruction so that special processing
will be done if the instruction causes an overflow. Unlike a divide-by-zero fault, an
overflow condition does not cause an interrupt automatically; the interrupt must be
explicitly specified by the INTO instruction. The remaining interrupt types correspond to
interrupts instructions imbedded in the interrupt program or to external interrupts.
The length of the string is usually stored as count in the CX register. The
incrementing or decrementing of the pointer, in string instructions, depends upon the
Direction Flag (DF) Status. If it is a Byte string operation, the index registers are updated
by one. On the other hand, if it is a word string operation, the index registers are updated
by two.
The CMPS instruction can be used to compare two strings of byte or words. The
length of the string must be stored in the register CX. If both the byte or word strings are
equal, zero Flag is set. The REP instruction Prefix is used to repeat the operation till CX
(counter) becomes zero or the condition specified by the REP Prefix is False.
This instruction scans a string of bytes or words for an operand byte or word
specified in the register AL or AX. The String is pointed to by ES: DI register pair. The
length of the string stored in CX. The DF controls the mode for scanning of the string.
Whenever a match to the specified operand is found in the string, execution stops and the
zero Flag is set. If no match is found, the zero flag is reset.
The LODS instruction loads the AL / AX register by the content of a string pointed
to by DS: SI register pair. The SI is modified automatically depending upon DF, If it is a
byte transfer (LODSB), the SI is modified by one and if it is a word transfer (LODSW),
the SI is modified by two. No other Flags are affected by this instruction.