Part Number:TMS320F28035




使用CCS3.3进行函数封装,在编译时出现错误的类型和相应的structure和union详情如图所示。在有同样的头文件情况下,封装另一个C语言编写的函数代码可以封装成.lib文件。出现这种错误该如何解决/
In CCS 3.3.The types that encountered errors during compilation and the corresponding structure and union details are shown in the figure. In the case of the same header file, encapsulating another function code written in C language can be encapsulated as a. lib file. How should this error be resolved.
thanks to everybody who tries to help me. a lot of appreciation.
Daniel:
您好
已经收到了您的案例,调查需要些时间,感谢您的耐心等待
,
Yongyang Liao:
您好,还没有解决方法吗?
,
Daniel:
您好
我怀疑汇编程序不支持你想要的操作。但我不确定我是否理解你想要做什么。
请进一步说明如何在汇编语言中使用.union指令。请列出.union及其所有相关代码行。并列出一条引用联合成员的指令。目前,请忽略构建问题。假设它按预期构建并运行。请仔细、详细地描述您预期的运行方式。
,
Yongyang Liao:
是涉及了到对结构体和联合体嵌套后的结构体or联合体进行读取或赋值的操作
,汇编中是用
该指令进行头文件的include,此头文件均为C语言编写
,
Daniel:
您好
我仍然不理解你的要求。但我几乎可以肯定汇编程序不支持它。
为了说明这一点,请根据您的第一篇文章考虑这段C代码。
#include <stdint.h>struct bits_tag {uint16_tf0 : 1;uint16_tf1 : 1;uint16_tf2 : 1;uint16_tf3 : 1;uint16_tf4 : 1;uint16_tf5 : 1;uint16_tf6 : 1;uint16_tf7 : 1;uint16_tf8 : 1;uint16_tf9 : 5;uint16_t f10 : 2; };union reg_tag {uint16_t all;struct bits_tag bit; };extern union reg_tag register_instance;uint16_t fxn() {return register_instance.bit.f3; }Build it …
cl2000 --src_interlist file.c选项–src_interlist使编译器保留生成的程序集文件,并将相关的C源语句作为注释插入。检查生成的file.asm。以下是函数中的关键说明。
ANDAL,@_register_instance,#0x0008 ; [CPU_ALU] |26|LSRAL,3; [CPU_ALU] |26|第一条指令将f3的值隔离到寄存器AL中。第二条指令将其右移,这样它的值就可以被视为完整的16位无符号值。编译器根据bits_tag结构的布局生成这些指令。没有一种方法可以让汇编程序表示如此复杂的操作。
,
Yongyang Liao:
您好,该问题是出现在 封装汇编语言写的中断函数 成为.lib文件时出现的问题,当汇编语言写的中断函数作为SOURCE文件在以往正常使用的程序中编译不会出现此问题
,
Daniel:
您好
Unfortunately, that description is vague. I don't know what it means. Please provide an example. Submit one of these assembly files. Show the commands you use to build it. Please do not use any screenshots. Copy and paste the text of the commands. The goal is for me to reproduce this issue, whatever it is.
TI中文支持网
,汇编中是用
该指令进行头文件的include,此头文件均为C语言编写




