INF: How Interrupts Are Handled in CodeView
PSS ID Number: Q11817
Article last modified on 10-27-1994

2.20 3.00 3.11 3.14

MS-DOS


-----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft CodeView for MS-DOS, versions 2.2, 3.0, 3.11, and 3.14
-----------------------------------------------------------------------

SUMMARY
=======

CodeView saves and restores about 60 interrupt vectors as a safety
feature. However, it only redirects the following 11 vectors for its
own use:

   00H     Divide by 0
   01H     Single step
   02H     Nonmaskable interrupt (NMI)
   03H     Breakpoint trap
   09H     Keyboard
   15H     Miscellaneous system services
   16H     Keyboard
   21H     DOS functions
   22H     DOS terminate
   23H     CTRL+C (^C)
   24H     Critical error

   Note: Interrupts 15H and 16H were not intercepted in versions of
         CodeView prior to 3.0.

The remaining 50 or so vectors are never altered by CodeView unless
something else (that is, the program being debugged) alters them after
CodeView has started up. In this case, CodeView restores them to their
original value as it exits.

MORE INFORMATION
================

When you enter G(o) and let your program run, CodeView relinquishes
control and lets all interrupts (except the nine listed above) flow
into your application for processing. However, when you hit a
breakpoint, the 8259 Programmable Interrupt Controller is masked. This
prevents interrupts from coming into your application while your
program is suspended. If you enter G(o) again, CodeView reenables
interrupts to your application.

To avoid a bug in the 8086 family, CodeView masks the interrupt
controller during T(race) commands and some P(rogram step) commands.
CodeView versions 2.0 and later solve this restriction by emulating
the interrupts for your application.

You normally do not single-step or trace real-time code, so this
should not be a problem for developers writing interrupt-driven code.
However, it is something you should be aware of if you are depending
on interrupts to get to your application. For example, it will not
work if you enter "T 1000" and expect your program to catch and
process interrupts during the trace. You will need to set a breakpoint
at the instruction with which you are concerned, then enter G(o).

Additional reference words: 2.20 3.00

KBCategory: kbtool
KBSubCategory: CvwIss

=============================================================================

Copyright Microsoft Corporation 1994.
