AnsweredAssumed Answered

Understanding CodeWarrior Disassembly

Question asked by M Mucker on Dec 18, 2006
Latest reply on Dec 20, 2006 by M Mucker
I am having some trouble understanding the disassembly of some of my code in CodeWarrior and am hoping some of y'all can help me out.
I have an interrupt that needs to occur every 65 us.  To make it as fast as possible, I'm writing it in assembly. A snippet of my code looks like:
    CPX m_ChannelDimValue:8;    BNE testCh9;    ORA #1;  testCh9:    CPX m_ChannelDimValue:9;    BNE testCh10;    ORA #2;  testCh10:    CPX m_ChannelDimValue:10;    BNE testCh11;    ORA #4;

 (Yes, I'm dimming lights.)  To determine how many clock cycles my routine will take, I right click on the code and select "Disassemble."  The output looks like this:
778:      CPX m_ChannelDimValue:8;  003f c30008   [4]             CPX   m_ChannelDimValue:8  779:      BNE testCh9;  0042 2602     [3]             BNE   L46 ;abs = 0046  780:      ORA #1;  0044 aa01     [2]             ORA   #1  0046          [5]     L46:      781:    testCh9:  782:      CPX m_ChannelDimValue:9;  0046 c30009   [4]             CPX   m_ChannelDimValue:9  783:      BNE testCh10;  0049 2602     [3]             BNE   L4D ;abs = 004d  784:      ORA #2;  004b aa02     [2]             ORA   #2  004d          [5]     L4D:      785:    testCh10:  786:      CPX m_ChannelDimValue:10;  004d c3000a   [4]             CPX   m_ChannelDimValue:10  787:      BNE testCh11;  0050 2602     [3]             BNE   L54 ;abs = 0054  788:      ORA #4;  0052 aa04     [2]             ORA   #4  0054          [5]     L54:   


First off, the formatting of this output is very difficult to read. Is there a way to clean up the formatting of this output?
Second, and more importantly, what are the nubmers in brackets? I think it's the number of clock cycles each instruction takes. But if that's the case, what is the [5] next to the labels?  It doesn't take 5 clock cycles to 'execute' a label... there's no instruction there to execute!  I'd really like to understand this output.