Viewing and Modifying Variables or Registers

The Variables window provides quick access to variables that are important in the program’s current context. Using the Variables window, you can modify the value of selected variables while the program is being debugged.

The Registers window displays the contents of the CPU registers, flags, and floating-point stack. Using the Registers window, you can change the value of any register or flag while the program is being debugged, or add registers (such as @EAX) to the Watch window.

To view the value in a register

  • From the View menu, click Debug Windows and Registers. Register values that have recently changed appear in red.

To view the return value of a function in the Variables window

  1. Step over or out of the function.

  2. In the Variables window, click the Auto tab.

  3. The Name column displays the return value as *Name*****returned, where Name is the name of the function. The Return Value icon (a clockwise arrow) appears to the left of the function name.

    The function return value appears in the Value column.

To turn off the display of return values in the Variables window

  1. From the Tools menu, click Options.

  2. In the Options dialog box, select the Debug tab.

  3. Under Variables Window, clear the Return Value check box.

  4. Click OK.

To change the value of a register

  1. From the View menu, click Debug Windows and Registers.

  2. In the Registers window, use the TAB key or the mouse to move the insertion point to the register value you want to change.

  3. Type the new value.

  4. Press ENTER.

Caution   Changing register values (especially in the EIP and EBP registers) can affect program execution.

To set or clear a Register flag

  1. From the View menu, click Debug Windows and Registers.

  2. In the Registers window, use the TAB key or the mouse to move the insertion point to the left of the value you want to change.

  3. Type the new value.

  4. Press ENTER.

The register flags and their set values for Intel x86 processors are the following:

Register Window Flags

Flag Set
Overflow O = 1
Direction D = 1
Interrupt I = 1
Sign S = 1
Zero Z = 1
Auxiliary carry A = 1
Parity P = 1
Carry C = 1