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.

[参考译文] CCS/EK-TM4C1294XL:在 c 文件中编译汇编代码时遇到错误#18

Guru**** 3004740 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/918011/ccs-ek-tm4c1294xl-facing-error-18-while-compiling-assembly-code-in-c-file

器件型号:EK-TM4C1294XL

工具/软件:Code Composer Studio

您好!

我尝试编译以下代码、

int main (空)

{

int val = 50;

_asm volatile (" MOV R0、%0":"r"(val));

返回0;

}

在编译时、我将面临这个问题、

错误#18:预期为")"

此错误发生在该代码片段的第二行(即_asm 行)。

我使用的是 Code Composer Studio 版本:10.0.00010 (编译器版本:TI v20.2.0.LTS)。

请提供建议。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    遗憾的是,TI ARM 编译器不支持 GCC 样式的 asm 语句,例如...

    [引用 user="Vishal K"]_asm volatile (" MOV R0、%0":"r"(val));

    有关更多详细信息、请在 TI ARM 编译器手册中搜索 标题为 _asm 语句的子章节。

    谢谢、此致、

    乔治