Professional Documents
Culture Documents
Chapter 4
There are two sources for external interrupts and two sources for exceptions:
1. Sources of Interrupts
Maskable interrupts, which are signaled via the INTR pin.
Non-maskable interrupts, which are signaled via the NMI (Non-Maskable Interrupt) pin.
2. Sources of Exceptions
Processor detected. These are further classified as faults, traps, and aborts.
Programmed. The instructions INTO, INT 3, INT n, and BOUND can trigger exceptions. These
instructions are often called "software interrupts", but the processor handles them as exceptions.
Identifying Interrupts
The processor associates an identifying number with each different type of interrupt or exception.
1
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
The NMI and the exceptions recognized by the processor are assigned predetermined identifiers in the
range 0 through 31. Not all of these numbers are currently used by the 80386; unassigned identifiers in
this range are reserved by Intel for possible future expansion.
The identifiers of the maskable interrupts are determined by external interrupt controllers (such as
Intel's 8259A Programmable Interrupt Controller) and communicated to the processor during the
processor's interrupt-acknowledge sequence. The numbers assigned by an 8259A PIC can be specified
by software. Any numbers in the range 32 through 255 can be used.
Following table shows the assignment of interrupt and exception identifiers.
Exceptions are classified as faults, traps, or aborts depending on the way they are reported and
whether restart of the instruction that caused the exception is supported.
Faults: Faults are exceptions that are reported "before" the instruction causing the exception. Faults are
either detected before the instruction begins to execute, or during execution of the instruction. If detected
during the instruction, the fault is reported with the machine restored to a state that permits the
instruction to be restarted.
Traps: A trap is an exception that is reported at the instruction boundary immediately after the
instruction in which the exception was detected.
Aborts: An abort is an exception that permits neither precise location of the instruction causing the
exception nor restart of the program that caused the exception. Aborts are used to report severe errors,
such as hardware errors and inconsistent or illegal values in system tables.
Table Interrupt and Exception ID Assignments:
Identifier Description
0 Divide error
1 Debug exceptions
2 Nonmaskable interrupt
3 Breakpoint (one-byte INT 3 instruction)
4 Overflow (INTO instruction)
5 Bounds check (BOUND instruction)
6 Invalid opcode
7 Coprocessor not available
8 Double fault
9 (reserved)
10 Invalid TSS
11 Segment not present
12 Stack exception
13 General protection
14 Page fault
15 (reserved)
2
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
16 Coprecessor error
17-31 (reserved)
32-255 Available for external interrupts via INTR pin
Figure shows the 256 interrupt vectors are arranged in the table in memory. Note that the instruction
pointer value is put in as the low word of the vector, and the code segment register is put in as the high word
of the vector. Each double word interrupt vector is identified by number from 0 to 255. Intel calls this
number the type of interrupt.
3
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
The lowest five types are dedicated to specific interrupts, such as the divide by zero interrupt, the
single step interrupt, and the non maskable interrupt. Interrupts types 5 to 31 are reserved by intel for using
more complex microprocessor, such as the 80286, 80386, and 80486. The upper 224 interrupts types, from
32 to 255, are available for use of hardware and software interrupts,
In the figure the vector for each interrupt types requires four memory location. therefore, when the 8086
represent to a particular type interrupt, it automatically multiplies the type by 4 to produce the desired address
in vector table. It then goes to the address in the table to get the starting address of the interrupt service
procedure.
BIOS:
BIOS is specific to individual computer system and it is provided by the manufacturer of the system. It
contains device driver for the following devices.
1) Keyboard
2) Printer
3) Auxiliary device
4) Date and time
5) Boot disk device
DOS - Kernel:
The Kernel is a proprietary program supplied by Microsoft corporation & provides collection of
hardware independent services on system function such as:
File & Record Management
Memory Management
4
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
DOS-BIOS interface:
One of task of the operating system is to interface with BIOS when there is a need to access its facilities.
When a user program requests an IO service of the operating system, it transfers the request to BIOS,
which in its turn accesses the requested device. Sometimes, a program makes request directly to bios,
such as for keyboard and screen services. At other times a program can bypass both the operating system
and BIOS to access a device directly. Figure below shows these alternative paths.
5
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
Loading of MS-DOS:
When the system is reset or started, the program execution begins at the address 0FFFF0H. The
control is transferred to system test code, power on self-test (POST). Then the control is transferred to
the ROM bootstrap routine, which reads thedisk bootstrap from the first sector of the system startup disk
into memory at some arbitrary address and transfers control to it.
The disk bootstrap checks to see if the boot disk contains DOS by checking the first sector of the root
directory for the file IO.SYS and MSDOS.SYS. If these are not found in the boot disk, the user gets a
prompt for changing the disk. If the two files are found, the disk bootstrap reads the files into memory
and transfers the control to IO.SYS
The IO.SYS file consists of two separate modules. The first is the BIOS, which contains the linked
set of resident device drivers for the console, auxiliary port, printer, clock devices and some hardware
specific initialization code. Second module consists of system initialization program, which determines
the RAM size in the PC. Then it loads the MSDOS.SYS program to its final memory location of the
DOS Kernel program.
The DOS Kernel initializes its tables and sets up its various work areas. It sets up the various
interrupt vectors for the DOS interrupts 20H-2FH pointing them to appropriate service routine. It then
6
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
loads and executes the device drivers. Now it returns the control to system initialization program
(SYSINIT).
The SYSINIT calls MS-DOS file service to open the CONFIG.SYS file. It contains the list of
additional device drivers that the user wants in his system. The required drivers are loaded into the
memory, initialized by calls to their INIT modules, and linked into their device driver list.
After SYSINIT calls the EXEC function to load the command interpreter (shell). Once the interpreter is
loaded, it displays a prompt and waits for the user to enter the command.
7
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
2- The .COM files are compact and are loaded .EXE files contain unique header, a relocation map, a
slightly faster than equivalent .EXE file, since these checksum and other information used by DOS along
contain only the execution code. with the execution code.
3- Near subroutine are used in .COM files. .EXE programs can contain more than one code
segment so both near and far CALLS are used.
5- Maximum length of program ( code and data) is .EXE program can be as large as available memory.
65536 bytes(64 K) minus 256 bytes of PSP.
6- In .COM format the size of the file is exact the In .EXE format the size of the file is size of the
size of the program. program plus the size of the header.
7- .COM program does not require file header. .EXE program need file header for relocation
process.
8
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
7- DOS is a collection of procedures to perform Its function is to setup hardware, load and start an
services such as formatting disc, portioning disc, operating system
creating, reading, writing files
OR OR
7- The DOS is a proprietary program supplied by It is residual program provided by the manufacturer.
Microsoft corporation & provides collection of Specific BIOS is available for individual computer &
hardware independent services on system function provided by manufacturer. It contains default
such as : resident hardware driver for :
1) File & Record Management 1) Console display & keyboard (CON)
2) Memory Management 2) Line printer (PRN)
3) Character Device I/O 3) Auxiliary Device (AUX)
4) Spawning of other program 4) Date & Time (Clock)
5) Access to the real time clock 5) Boot Disk Device (block device)
10- For example: INT 21 H For example: Video services INT 10 H etc.
9
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
10
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
11
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
12
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
13
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
14
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
15
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
Summer 2015
1. a) Attempt any THREE of the following : 12
(iii) How the interrupt is processed in X86 processor ?
b) Attempt any ONE of the following : 6
Winter 2015
1. a) Attempt any THREE of the following: 12
(iv) Differentiate between .COM and .EXE programs. (any four points)
16
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
Summer 2016
1. Attempt any FIVE of the following: 20
g) Describe maskable and non maskable interrupts of X86 processor.
Winter 2016
1. Answer any FIVE of the following: 20
e) State the priority interrupts of 80286.
f) Describe any four DOS interrupts.
g) State any four difference between .COM and .EXE program.
17
Computer Department, Jamia Polytechnic (0366) Advanced Microprocessor (AMI 17627)
18