如题,怎样在ccs5中的c文件使用内联汇编?我现在想在一个函数中读取SP栈指针的值,要怎么做?
我的尝试:在c函数中写asm(“mov sp &c”);编译正确,但是debug的时候提示:Load Program Error,请问该如何解决?
使用msp430g2553 launchpad
sdk:ccs5
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.
asm
也可以写成 _asm。功能是在c程序中直接嵌入汇编语言。
Asm(“string”);
其中string必须是有效的汇编语句。
图片里的错误是debug烧写的时候发生的,说明没有生成.out文件可以提供烧写。你需要build all,然后看console里显示出来的错误信息。
C语言中内联的汇编文档请参考 Compiler Users Guide (section 3.6 and 6.5.4)