Mixed Source Code and Disassembly Code

Use the Mixed code format of the source view to display the source code line and its associated disassembly code. This format enables you to understand how disassembly code lines relate to the source code lines.

There are three different Mixed formats, according to what type of code drives the mixed display:

Mixed by Execution

The disassembly code is in order and the relevant source code line appears before the disassembly code lines. This view shows the disassembly lines according to the order of their execution.

Advantage: Shows the disassembly code as it appears in the binary file.

Disadvantage: Not easy to follow the flow of the source code.

Mixed by Source

The source code is in order and the relevant disassembly code lines appear under each source code line. This view shows the assembly lines that are generated from each source line.

Advantage: Use this to locate the disassembly code lines related to your source lines.

Disadvantage: The code shown does not appear in the actual execution order. The compiler optimization changes the order.

Mixed by Combination

Both the source and the disassembly code appear in their order. In this format, in order to keep the numeric order of the code lines, some disassembly code lines may appear under an unrelated source code line. You can check the source code line in the Line Number column.

Advantage: Can often provide the advantages of both the other methods.

Disadvantage: May generate chunks of disassembly code that are misplaced from their original code, due to compiler reassignment.

To access the different mix modes:

Right-click the source pane and select the desired mix format.

The format you choose will be the default format, next time you choose Mixed format.

Example

This code example enables showing the different mixed views and how they are presented.

The views show the resulting mixed format views using the different options. See the RVA and the Line Number on the left columns.

The basic code:

float divd_rout( float par1, float par2)

{

  int i;

  float ret_value;

 

  for (i=0;i<10;i++)

    ret_value = par1/par2;

 

  return ret_value;

}

View using Mixed by Combination:

Sample code shown with the Mixed by Combination option

View using Mixed by Source:

Sample code shown using Mixed by Source option

View using Mixed by Execution:

note

You can set the visualization of the source view, right-click the source and select Mixed Mode:

Bookmarks are not available for Mixed Extended Visualization Mode.