# Working with Microcode

The Microcode view displays the decompiler's intermediate representation (microcode) at various maturity levels, allowing you to explore and adjust how the pseudocode is generated step-by-step.

## Opening the Microcode view

You can open the Microcode view in two ways:

* Press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>F8</kbd> while viewing a function
* Navigate to **View → Open subviews → Microcode**

## Maturity levels

During decompilation, the microcode progresses through different maturity levels. To navigate between maturity levels, you can use the context menu or the <kbd>></kbd> and <kbd><</kbd> keys to increase or decrease the currently displayed maturity level.

## Microcode manipulation

The Microcode view allows you to modify the decompilation process by manipulating microcode instructions.

These modifications will propagate to higher maturity levels and ultimately affect the final pseudocode output.

### Deleting instructions

To delete an instruction from the microcode, position the cursor on the instruction you want to delete and press the <kbd>Delete</kbd> key or select **Delete instruction** from the context menu.

After deleting an instruction, you can restore it by right-clicking it in the Microcode view and selecting **Restore instruction** from the context menu.

### Specifying operand values

You can specify values for operands of microcode instructions to influence the decompilation process. To do this, right-click on the operand you want to specify and select **Specify value...** from the context menu.

This action inserts a new `mov` instruction that assigns the specified value to the selected operand. A dialog will open with the following fields:

* **Operand**: Pre-filled with the current operand, if one exists. You can modify it if needed.
* **Value**: The value you want to assign to the operand.
* **Insert after**: Check this option to insert the new `mov` instruction after the current instruction; uncheck it to insert before.

## Analysis tools

The Microcode view provides several analysis and visualization tools accessible from the context menu.

### Structural analysis

Reduces the control flow graph (CFG) into high-level control structures such as `if`, `while`, `do`, and `switch` statements. A graph of each intermediate reduction step is displayed, followed by a final tree showing the resulting control structure hierarchy. Edges that could not be structured are represented as `goto` regions.

### Display chains

Computes and displays def-use (DU) and use-def (UD) chains for the current microcode. DU chains track where a value defined at one point is subsequently used; UD chains track where a value used at one point was previously defined.

Two chooser windows open:

* **du-ud chains**: chains for register operands
* **stkvar du-ud**: chains for stack variable operands

### Display local types

Opens a chooser showing types encountered during decompilation.

The chooser has the following columns:

| Column          | Description                                                                                  |
| --------------- | -------------------------------------------------------------------------------------------- |
| **N**           | Row index                                                                                    |
| **id**          | Address identifier for the type                                                              |
| **source/deps** | How the type was introduced (NONE, WEAK, FUNC, or DATA) and addresses of dependent functions |
| **type**        | The type declaration                                                                         |

### Display microcode graph

Shows the control flow graph, where each node is a basic block containing its microcode instructions.

### Display ctree

Converts the microcode into a ctree (the decompiler's C-level AST) and displays it as a tree graph. The node nearest to the current cursor position is highlighted in green.

{% hint style="info" %}
This action is only available when the microcode maturity level is **MMAT\_LVARS** or higher, since the ctree requires local variable allocation to have been performed.
{% endhint %}

## Display options

The Microcode view has several toggles that control what information is shown. These are available from the context menu and their settings are persisted across sessions.

### Short view

Switches between a compact (**short**) and a **detailed** display of the microcode.

In detailed mode, each basic block includes additional information:

* **Block headers** with use-def information, predecessor/successor lists, and block attributes
* **Instruction metadata** such as flags, split sizes, and operand properties

### Show number origins

Shows where numeric constants originate. For example, `#3.8` becomes `#3@3B0A.8`, where `@3B0A` is the origin.

### Show value numbers

Displays Global Value Numbering (GVN) identifiers on operands. GVN assigns the same number to operands that are known to hold the same computed value. For example, `mov rax.8{5}, r8.8{5}`, where `{5}` indicates both operands hold the same computed value.

### Show addresses

Displays addresses at the beginning of each line, before the block and instruction numbers.
