When exporting disassembly, sometimes you need to modify it so that it is accepted by a specific assembler you’re using. One little-known fact is that some of IDA’s processor modules support different assembler syntaxes, so it may be useful to try a different one to see if it matches your needs better.
The assembler can be changed via Options > General…, Analysis tab:
For example, on x86 the TASM Ideal syntax may be selected instead of the default Generic one (based on MASM). One feature of this syntax is that it always uses brackets for instructions which dereference memory pointers.
For ARM, you can choose a legacy assembler, which was used before introduction of UAL (unified assembly language) with Thumb-2. For example, it used explicit STMFD
and LDMFD
instructions instead of the more convenient PUSH
and POP
introduced for Thumb.
Nowadays, IDA defaults to the generic UAL assembler which is de-facto standard and easier to read.
For some of the older processors the selection of assemblers can be quite extensive; they often didn’t have a freely available official assembler so many third-party alternatives were available.