binutils Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
x86/disasm

X86/disasm: Rework comment handling in the disassembler

The x86 disassembler now handles comments like operands, allowing them to be emitted in the same order.

The x86 disassembler’s comment handling was reworked to align with operand handling. This change enables comments to be emitted in the same order as operands, improving the clarity of disassembled code. Tests were added to verify the new comment handling in both Intel and AT&T syntax.

In Details

The x86 disassembler is responsible for converting machine code back into assembly language. Disassembly annotations provide additional context, such as symbol names for immediate values. This commit refactors the comment emission logic within opcodes/i386-dis.c to ensure comments are displayed consistently with operands. The change avoids treating symbol names as "comment starts".

For Context

A disassembler translates machine code back into human-readable assembly language. This is useful for understanding how a compiled program works or debugging issues. The x86 disassembler is the part of the GNU binutils toolchain that performs this translation for x86-based architectures. This change improves how the disassembler adds explanatory comments to the disassembled code, making it easier to read and understand.

Filed Under: disassemblerx86comments