15.3.8 Displaying the Processor Registers

Choosing the Register command from the View menu (or pressing F2) opens a window on the right side of the screen. The microprocessor's current register values appear in this window. At the bottom of the window is a group of mnemonics representing the processor flags. Pressing F2 a second time closes the window.

Summary: Video intensity shows changed values.

When you first open the Register window, all register and flag values are shown in normal text. When you change a register or flag, the changed value is highlighted. For example, suppose the overflow flag is not set when the Register window is first opened. The corresponding mnemonic is NV and appears in light gray. If the overflow flag is subsequently set, the mnemonic changes to OV and appears in bright white. If your computer uses an 80386/486 processor and you are running the real-mode version of CodeView choosing the 386 Instructions command from the Options menu displays the registers as 32-bit values. Choosing this command a second time returns to the 16-bit display.

You can also display the registers of an 8087–80387 coprocessor (or the built-in coprocessor of the 80486) in a separate window by choosing the 8087 command from the View menu. If your program uses the coprocessor emulator, the emulated registers are displayed instead.

Summary: The Register values reveal program status.

The Register window is a valuable debugging tool. Almost every assembly instruction alters a register or flag. As each line of code is executed, the register values and flags that change are highlighted, so you can see whether each instruction does what you intended it to.

Also, when you execute an instruction whose operand has a memory location (such as a variable), the effective address of the operand, as well as the value stored at that address, is displayed at the bottom of the Register window.