Professional Documents
Culture Documents
THE INTERRUPT
STRUCTURE OF 8086
CHAPTER 8
its
current activity and executes the Interrupt
service routine corresponding to the
interrupt request
After that ,it resumes the previous activity
Interrupts can occur at any time
Interrupts of 8086
8086 has hardware interrupts, software interrupts
Interrupt Response-Steps
Contd.
vii. The program corresponding to the ISR is
the
execution of its current task and takes on another
task as required by the interrupting source.
This program, or routine as it may be called, is
designated as an interrupt service routine (ISR) or
interrupt handler.
The address of an ISR is called its interrupt
vector.
10
11
12
Example 8.1
13
Call?
14
15
or trace.
Single stepping is an important idea in debugging.
During logical debugging of our programs, we
16
17
18
19
20
21
Hardware Interrupts
INTR
NMI
22
23
INTR
This is the non-vectored interrupt pin of the
24
25
26
27
as an Interrupt Pin?
28
C:\>debug
-dffff :0000
FFFF:0000 EA 5B E0 00 F0 30 36 2F-32 30 2F 30 35 00
FC 00. [...06/20/05...
The first 5 bytes, constitute the assembly code for the
jump instruction i.e., JMP (EA) F000:E05B.
The next eight bytes were originally called the RELEASE
MARKER by IBM, as they always contain the release date
of the code i.e., BI0S (which is 20th June 2005 for this PC).
See the ASCII code of this marker:
30 36 2F 32 30 2F 30 35 i.e., 06/20/05 in the format
mm/dd/yy.
The x86 Microprocessor - Lyla B Das
29
30
Priority of Interrupts
31
32
Software Interrupts
When an interrupt is initiated by an
instruction,
it is called a software interrupt. The format of
this instruction is: INT type number
The type numbers can vary from 0 to 255.
Thus, the user can write any procedure as
an ISR, store it in some address in memory
and call it by using the instruction INT n.
33
Instruction?
34
35
36
Video Adapter
In any PC, there is the display unit and a video
adapter.
This adapter is the hardware that provides the
system its display capabilities.
It is also designated by names such as video card
and graphics card.
The video display usually has a controller which
takes care of the complexities of the display
mechanism.
The IBM PC memory map (Table 7.3.) shows RAM
from A0000H to BFFFFH (128K) dedicated to video.
This area of memory is called video display RAM
(VDR) or video memory or VRAM.
The x86 Microprocessor - Lyla B Das
37
38
39
40
41
color.
This byte defines the background and
foreground colors.
Foreground refers to the color of the character
displayed.
Background is the color that surrounds a
character.
The x86 Microprocessor - Lyla B Das
42
Color Configuration
43
Example 8.2
Find the attribute byte for the following cases
46
48
49
50
51
Example 8.5
Write a program that does the following:
52
Example 8.6
Write a program to display HELLO vertically
53
Example 8.7
Write a simple program to make the screen
54
55
green.
For this a 16-bit number with the attribute
byte and ASCII character is loaded in AX.
This word is written into the 2000 locations
(25 80 characters) starting from the address
B800H.
Using instructions, this display can be easily
accomplished.
The x86 Microprocessor - Lyla B Das
56
Example 8.8
Example 8.9
Display HELLO WORLD in the centre of the
screen.
57
computer keyboard.
For that, we have to understand the computer
keyboard, as well as the hardware associated
with the keyboard.
58
Keyboard Interfacing
59
Computer Keyboard
Keyboard Controller
The keyboard which is connected to the
60
61
Scan Code
62
63
64
65
66
67
68
69
Example: 8.10
Explain what the following program does.
.MODEL TINY
.CODE
.STARTUP
MOV AH, 10H
INT 16H
MOV AH, 12H
INT 16H
.EXIT
END
The x86 Microprocessor - Lyla B Das
70
Example 8.11
Write a program that fills up the screen with
71
72
Hooking an Interrupt
73
74
75
stay resident.
Terminate the current program or process, but
make it resident in memory and attempt to
set the current memory allocation to the
number of paragraphs specified in DX.
Input: AL = return code, and DX = requested
number of paragraphs.
The function 31H makes our ISR resident in
memory.
The x86 Microprocessor - Lyla B Das
76
Example 8.12
A new ISR named NEW60 is to be installed
77
78
Example 8.13
79
80
81
Example 8.14
Example 8.15
Write a similar program, except that the hot
82
Example 8.16
Write a TSR program activated by the hot key
83