Microsoft KB Archive/71486

= Structure of Interrupt Vector Table =

Article ID: 71486

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft MS-DOS 1.0 Standard Edition
 * Microsoft MS-DOS 2.11 Standard Edition
 * Microsoft MS-DOS 3.1
 * Microsoft MS-DOS 3.2 Standard Edition
 * Microsoft MS-DOS 3.21 Standard Edition
 * Microsoft MS-DOS 3.3 Standard Edition
 * Microsoft MS-DOS 3.3a
 * Microsoft MS-DOS 4.0 Standard Edition
 * Microsoft MS-DOS 4.01 Standard Edition
 * Microsoft MS-DOS 5.0 Standard Edition
 * Microsoft MS-DOS 5.0a
 * Microsoft MS-DOS 6.0 Standard Edition
 * Microsoft MS-DOS 6.2 Standard Edition
 * Microsoft MS-DOS 6.21 Standard Edition
 * Microsoft MS-DOS 6.22 Standard Edition

-



This article was previously published under Q71486



SUMMARY
The bottom 1K (1024 bytes) of system memory is devoted to the storage of interrupt vectors. An interrupt vector is a 4-byte value of the form offset:segment, which represents the address of a routine to be called when the CPU receives an interrupt. Some vectors do not point to executable code, but rather to a data structure of some sort. For example, the vector for interrupt 1Eh points to an 11-byte disk base table containing information on floppy drives. The interrupt vector table is a feature of the Intel 80x86/8088 family of microprocessors.



MORE INFORMATION
Because each interrupt is a 4-byte value, the maximum number of vectors that can be stored in the interrupt vector table is 256. Each vector is located at segment:offset address: 0000:(int #)*4. Thus, the vector for int 24h (critical error) is located at address 0000:0090.

For example, a partial hex dump of the interrupt vector table shows:   0000:0090    22 03 A1 2A .. .. .. .. .. .. .. .. .. .. .. .. The location that will be jumped to on int 24h is 2AA1:0322.

Programming Considerations
While you can establish your own interrupt handlers by replacing the appropriate vector with the address of your handler routine, this approach is not advisable. A program can be interrupted before changing all four bytes of a vector, thus causing erroneous, possibly catastrophic, operation should the interrupt be issued. For this reason, and to ensure compatibility with future releases of MS-DOS, interrupt vectors should accessed using int 21h functions 25h (set interrupt vector) and 35h (get interrupt vector).

