简体   繁体   English

MACRO中的断点-IAR组件MSP430

[英]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. 我试图测量每条指令在汇编程序中执行时的时钟,但是IAR不允许我在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. 我可以在MACRO调用之前设置一个断点,然后单击几次“ Step Over”直到它退出循环,但是我看不到MACRO上执行的每条指令,我每次只能看到同一条指令闪烁(调用MACRO),直到完成,然后移至下一条指令。

Does anyone know how to put a breakpoint inside a MACRO? 有谁知道如何在宏内放置一个断点? Or how to measure the clocks each instruction inside a MACRO takes? 还是如何测量MACRO内部每个指令占用的时钟?

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. 如果您想知道宏运行所需的时钟或处理器周期数,则可以使用处理器的数据表在反汇编窗口中看到的已编译输出中的每条指令的周期计数加起来,或者可以在“ CPU寄存器”窗口中查看CYCLECOUNTER值。 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. 它可以在调试器仿真器模式下使用,也可以与某些MSP系列(我将其与MSP430F5XXX结合使用)一起使用,并且可以与物理设备和JTAG / SPY-BI-WIRE接口一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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