This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C/C++ disassembly output to file



I am trying to get disassembled output from my MSP430 program, interlaced with C/C++ source code, to try to to understand how the compiler is generating assembly from my input sources and diagnose unexpected bloat.  In CCS, there is a very nice GUI representation in the disassembly window that looks like this:

$C$L1:
004be8: 0735 0008 MOVA 0x0008(R7),R5
65 r = (*s)(this, e); // invoke state handler s
004bec: 07CC MOVA R7,R12
004bee: 0ACD MOVA R10,R13
004bf0: 1345 CALLA R5
004bf2: 0CC6 MOVA R12,R6
004bf4: 9266 CMP.B #4,R6
004bf6: 2005 JNE ($C$L2)
75 r = QEP_TRIG_(s, QEP_EMPTY_SIG_); // find superstate of s
004bf8: 07CC MOVA R7,R12
004bfa: 018D 345E MOVA #0x1345e,R13
004bfe: 1345 CALLA R5
004c00: 0CC6 MOVA R12,R6
77 } while (r == Q_RET_SUPER);
$C$L2:
004c02: 9076 0003 CMP.B #0x0003,R6
004c06: 27F0 JEQ ($C$L1)
79 if (r == Q_RET_TRAN) { // transition taken?
004c08: 9366 CMP.B #2,R6
004c0a: 20FA JNE ($C$L30)
81 int8_t ip = s8_n1; // transition entry path index
004c0c: 433A MOV.W #-1,R10
87 path[0] = m_temp; // save the target of the transition

However, this is a "moving window" that changes its extent as you scroll, and there is no way to save the entire disassembly to a file.

Using the CCS toolchain binaries I have been unable to get this kind of output.

How can I get either CCS or the toolchain to give me this kind of source code output for the whole program?

  • Hi Marc,

    Run dis430.exe on your *.out file. It will generate the output you are looking for. You probably want to pipe the output to a file:

    > dis430.exe myprogram.out > disassembly.txt

    the dis430.exe utility comes with the compiler. It can be found in:

    <INSTALL DIR>\ccsv5\tools\compiler\msp430_x.x.x\bin

    Thanks

    ki

  • Ki, thanks for the response.  dis430 generates the complete disassembly, but it does not interlace it with the original source code like the Eclipse disassembly window does.  I'm looking for the interlaced output.

  • The interlaced output is something that the debugger handles. I don't think there is a way to get out like that from the build tools. And there is no way to capture the entire disassembly view output to a file