Structure of Interrupt Vector Table (71486)



The information in this article applies to:
    Microsoft MS-DOS operating system 1.x
    Microsoft MS-DOS operating system 2.11
    Microsoft MS-DOS operating system 3.1
    Microsoft MS-DOS operating system 3.2
    Microsoft MS-DOS operating system 3.21
    Microsoft MS-DOS operating system 3.3
    Microsoft MS-DOS operating system 3.3a
    Microsoft MS-DOS operating system 4.0
    Microsoft MS-DOS operating system 4.01
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 5.0a
    Microsoft MS-DOS operating system 6.0
    Microsoft MS-DOS operating system 6.2
    Microsoft MS-DOS operating system 6.21
    Microsoft MS-DOS operating system 6.22

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).

REFERENCES

"DOS Programmer's Reference" by Terry Dettmann, QUE Corporation

"Advanced MS-DOS Programming" by Ray Duncan, Microsoft Press

"The New Peter Norton Guide to the PC and PS/2," Microsoft Press

Modification Type: Major Last Reviewed: 5/12/2003
Keywords: KB71486