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.

[参考译文] TMS320F28377S:ASM 和 C 程序

Guru**** 2468460 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1190118/tms320f28377s-asm-and-c-program

器件型号:TMS320F28377S

在 C 程序中定义结构、并访问汇编器中结构的成员。 结构的名称是 StruVar。 有五个 float32类型的成员、它们是 Fvar0、Fvar1、Fvar2、Fvar3、 和 Fvar4。 以下程序是结构变量的操作。 正确吗?

MOVW DP、#_StruVar.Fvar2

MOV32 @_StruVar.Fvar2、R0H

MOVL XAR5、#_StruVar.Fvar3

MOV32 * XAR5、R2H

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

    有可能...

    [引用 userid="327785" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1190118/tms320f28377s-asm-and-c-program "]定义 C 程序中的结构并访问汇编器中结构的成员。

    但它不像您描述的那样起作用。

    以下是支持的内容。  在 C 头文件中定义结构。  在汇编源文件中、使用.cdecls 指令包含该头文件。  这会自动生成.struct 和.endstruct 指令。  根据这些.struct 指令编写汇编代码。  有关详细信息、  请在 C28x 汇编工具手册中搜索 标题为 "使用汇编源代码共享 C/C++头文件"的章节。

    谢谢、此致、

    乔治