In The Real Mode, Each of These Instructions Fetches A Vector From The Vector Table, and Then Calls The Procedure Stored at The Location Addressed by The Vector
In The Real Mode, Each of These Instructions Fetches A Vector From The Vector Table, and Then Calls The Procedure Stored at The Location Addressed by The Vector
Microprocessor
INT Interrupt:-
An interrupt is either a hardware-generated CALL (externally derived from a hardware
signal) or a software-generated CALL (internally derived from the execution of an
instruction or by some other internal event).
The microprocessor has three different interrupt instructions that are available to the
programmer: INT, INTO, and INT 3. In the real mode, each of these instructions fetches a vector
from the vector table, and then calls the procedure stored at the location addressed by the vector.
Interrupts are used to get the attention of the microprocessor. In the 8086/88 there are a total of
256 interrupts: INT 00, INT 01, INT 02, . . . . . ., INT FF. As mentioned above, the address that
has an interrupt jumps in always four times the value of the interrupt number. For example INT
03 will jump to memory address 0000CH (4 x 03=12=0CH). Table below shows a partial list of
interrupts, commonly referred to as the interrupt vector table.
Every interrupt has a program associated with it called the interrupt service routine (ISR). When
an interrupt is invoked, the CS: IP address of its ISR is retrieved from the vector table (shown
above). The lowest 1024 bytes (256 x 4= 1024) of RAM are set aside for the interrupt vector
table and must not be used for any other function.
Example:-
Find the physical and logical addresses of the vector table associated with
a. INT 14H
The physical address for INT 14h is 0050H-0053H according to the formula described above i.e.
4 X 14H=50H. This gives the logical address of 0000:0050H to 0000:0053H.
TYPE 0 interrupt represents division by zero situation.
TYPE 1 interrupt represents single-step execution during the debugging of a program.
TYPE 2 interrupt represents non-maskable NMI interrupt.
TYPE 3 interrupt represents break-point interrupt.
TYPE 4 interrupt represents overflow interrupt.
Example 2:
Program that takes the value from user and show the output value of DX register in AL.
mov ax,0h
mov ah, 01h ; accepts the character in al
int 21h
aaa
mov ah,02h ; outputs the character from dl
int 21h
Task 1:
Take input from the user, increment that and show the incremented value at the output
Take the input from the user, decrement it and show the decremented value at the output
Task 2:
Take the ascii value 31 and 35 from user and show the result of their sum?
Task 3:
Design a calculator that takes three input numbers from user and perform addition, subtraction,
division and multiplication on two of them and return the output value to the user. Third value is
used to decide which operation it has to perfrom e.g 1=add,2=sub…….