Skip to content

Fix #96: Make x86 disassem produce code usable by gcc/clang

Raymond Toy requested to merge issue-96-x86-disassem into master

We make the x86 disassembler produce code that can (almost) be directly used by gcc or clang to produce the same code as produced by the compiler.

This means:

  1. Make the disassembler print the radix indicator ("#x") by default.
  2. Add ".intel_syntax noprefix" to tell gcc/clang the syntax being used. This is added only for x86.
  3. Use /* ... */ for comments instead of ;. This is done for all archs. We also set *print-right-margin* to 100 so that we're less likely to wrap long things, or truncate the output.
  4. Increase *note-column* for x86 because some instructions can be rather long; this makes the note columns more likely to line up neatly without having some instructions pushing the note column farther right so that they don't line up neatly.

This doesn't solve everything; we still have an issue with printing call in a way that's accepted by both clang and gcc and so that both clang and gcc produce the same code.

Edited by Raymond Toy

Merge request reports