How Interrupts Are Handled in CodeView

ID Number: Q11817

1.x 2.00 2.10 2.20 2.30 2.35 3.00 3.10 3.11 3.14

MS-DOS

Question:

How does CodeView handle interrupt vectors? Does it mask any

interrupts when it runs?

Response:

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.

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: 1.0 1.00 1.1 1.10 1.11 2.2 2.20 2.30 2.30

2.35 3.0 3.00 3.1 3.10 3.11 3.14