Share via


How to: Use the Disassembly Window

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic does not apply Topic applies Topic does not apply

Pro, Premium, and Ultimate

Hidden by Default

Topic applies Topic applies Topic applies Topic applies

This feature is available only if address-level debugging is enabled the Options dialog box, Debugging node. It is not available for Script or SQL debugging.

The Disassembly window shows assembly code corresponding to the instructions created by the compiler. If you are debugging managed code, these assembly instructions correspond to the native code created by the Just-in-Time (JIT) compiler, not the Microsoft intermediate language (MSIL) generated by the Visual Studio compiler.

In addition to assembly instructions, the Disassembly window can show the following optional information:

  • Memory address where each instruction is located. For native applications, this is the actual memory address. For Visual Basic, C#, or managed code, it is an offset from the beginning of the function.

  • Source code from which the assembly code derives.

  • Code bytes—byte representations of the actual machine or MSIL instructions.

  • Symbol names for the memory addresses.

  • Line numbers corresponding to the source code.

Assembly-language instructions consist of mnemonics, which are abbreviations for instruction names, and symbols that represent variables, registers, and constants. Each machine-language instruction is represented by one assembly-language mnemonic, usually followed by one or more variables, registers, or constants.

If you cannot read assembly language and want to take full advantage of the Disassembly window, consult a good book on assembly-language programming. Assembly-language programming is beyond the scope of what we can address in this brief introduction to the Disassembly window.

Because assembly code relies heavily on processor registers or, in the case of managed code, common language runtime registers, you will often find it useful to use the Disassembly window in conjunction with the Registers window, which allows you to examine register contents.

You probably will never have the desire or need to view machine-code instructions in their raw, numeric form, rather than assembly language. However, if you want to do so, you can use the Memory window for that purpose or choose Code Bytes from the shortcut menu in the Disassembly window.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.

To display the Disassembly window

  • On the Debug menu, choose Windows, and click Disassembly.

    The debugger must be running or in break mode.

To turn optional information on or off

  • Right-click the Disassembly window, and set or clear the desired options in the shortcut menu.

    A yellow arrow in the left margin marks the location of the current execution point. For native code, this corresponds to the CPU's program counter. This location shows the next instruction that will be executed in your program.

    For more information, see Paging Up or Down in Memory.

See Also

Tasks

How to: Use the Registers Window

Concepts

Viewing Data in the Debugger