The QEMU -d asm_in
and -d asm_out
options are useful for examining the dynamically generated asm created by QEMU.
Unfortunately (for me) it defaults to AT&T syntax. Is there an option to output in Intel syntax?
No, QEMU doesn't provide a config option for choosing the disassembly syntax. (We use the binutils disassembler sources, so the code to output Intel syntax rather than AT&T is all there, but we don't wire it up to something the user can change.)
Thanks to Peter Maydell's answer we know that QEMU's disassembler is based on binutils. But binutils disassembler actually does support Intel syntax, we just need to know what to change to activate it. If you're willing to recompile QEMU, here's a patch which will force Intel syntax unconditionally:
diff --git a/disas/i386.c b/disas/i386.c
index f1e376c..4493115 100644
--- a/disas/i386.c
+++ b/disas/i386.c
@@ -3682,7 +3682,7 @@ static char scale_char;
int
print_insn_i386 (bfd_vma pc, disassemble_info *info)
{
- intel_syntax = -1;
+ intel_syntax = 1;
return print_insn (pc, info);
}
in_asm
and out_asm
are now correct, not sure how to test QEMu monitor).