lst file of compiler output?

26 Nov 2009

Sometimes I like to see the assembly language output of the compiler, for example, if it is time-critical. Is there any way to see this?

26 Nov 2009

Hi SimonB,

Simon Blandford wrote:
Sometimes I like to see the assembly language output of the compiler, for example, if it is time-critical. Is there any way to see this?
There is no way to see this in mbed at the moment, and we're not in a rush to put it in. But I admit I occasionally want it too, to sanity check for example. It could be a useful learning aid.

Could you perhaps add your request to the Suggestions thread, ideally with any notes on why you want it, how you'd use it, and even any ideas on how you'd like it to work. Our emphasis is certainly on keeping things simple, so knowing what the intent is may be really helpful in understanding what is the right thing to do here (even if it is nothing!).

Simon

26 Nov 2009

Not as nice as the compiler output, but you can get a disassembly. Get an objdump with Thumb2 support (e.g. from CodeSourcery, or build your own). Then run (assuming you've for Cortex-M3 version):

objdump -D -b binary -m arm -M force-thumb mycode.bin

The first hundred instructions or so will make no sense because that's the area of exception vectors. The address of entry point is the second word (offset 4) of the binary, minus the Thumb mode bit.

Or you can use IDA Pro :)