简体   繁体   中英

Breakpoint in MACRO - IAR Assembly MSP430

I am trying to measure the clocks each instruction takes when executed in my assembly program but IAR won't allow me to set breakpoints inside a MACRO. I can set a breakpoint before the MACRO call and just click "Step Over" a few times until it comes out of the loop but I cannot see each instruction on the MACRO executed, I can only see the same instruction flash each time (the one that calls the MACRO) until it finishes and then moves to the next instruction.

Does anyone know how to put a breakpoint inside a MACRO? Or how to measure the clocks each instruction inside a MACRO takes?

Thanks!

If you set a breakpoint just before the macro you can then set another breakpoint at any point in the disassembly window where the code generated by the macro function is listed. You can step through the code in any way that you like by setting the breakpoints on the disassembled code.

If you want to know how many clocks or processor cycles the macro takes to run then you can either use the data sheet for the processor to add up the cycle counts for each of the instructions in the compiled output visible in the disassembly window, or you can look at the CYCLECOUNTER value in the CPU Registers window. This works in the debugger simulator mode or with some families of the MSP (I use it with the MSP430F5XXX) it works with physical devices and the JTAG/SPY-BI-WIRE interface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM