DATA_SECTION pragma
来源:互联网 发布:淘宝被加黑名单怎么查 编辑:程序博客网 时间:2024/05/16 11:30
ti的帮助文档里是这么讲的:
The DATA_SECTION pragma allocates space for the symbol in a section called section name.
The syntax for the pragma in C is:
#pragma DATA_SECTION (symbol, "section name");
The syntax for the pragma in C++ is:
#pragma DATA_SECTION ( "section name");
The DATA_SECTION pragma is useful if you have data objects that you want to link into an area separate from the .bss section.
This directive is illustrated in the following example.
Using the DATA_SECTION Pragma
a) C source file
#pragma DATA_SECTION(bufferB, "my_sect")
char bufferA[512];
char bufferB[512]:
b) C++ source file
char bufferA[512];
#pragma DATA_SECTION("my_sect")
char bufferB[512];
c) Assembly source file
.global _bufferA
.bss _bufferA,512,4
.global _bufferB
_bufferB: .usect "my_sect",512,4
我理解的意思是:
定义一个数据段:
段名为: "section name"
段的内容在: symbol 里
The DATA_SECTION pragma allocates space for the symbol in a section called section name.
The syntax for the pragma in C is:
#pragma DATA_SECTION (symbol, "section name");
The syntax for the pragma in C++ is:
#pragma DATA_SECTION ( "section name");
The DATA_SECTION pragma is useful if you have data objects that you want to link into an area separate from the .bss section.
This directive is illustrated in the following example.
Using the DATA_SECTION Pragma
a) C source file
#pragma DATA_SECTION(bufferB, "my_sect")
char bufferA[512];
char bufferB[512]:
b) C++ source file
char bufferA[512];
#pragma DATA_SECTION("my_sect")
char bufferB[512];
c) Assembly source file
.global _bufferA
.bss _bufferA,512,4
.global _bufferB
_bufferB: .usect "my_sect",512,4
我理解的意思是:
定义一个数据段:
段名为: "section name"
段的内容在: symbol 里
在CCS编程中,如果我们不指定变量的存放位置,编译器会自动的给变量分配一个位置,但是如果有的时候需要把变量放在一个特定的空间内,我们应该如何操作呢,CCS提供了如下的两个指令
#pragma CODE_SECTION
#pragma DATA_SECTION
其中data_section是针对数据空间的,code_section是针对程序空间的,具体的使用办法是
#pragma DATA_SECTION(bufferB, ”my_sect”)
char bufferB[512];
在.cmd文件中建立对应的section就可以使用了.
MEMORY
{
PAGE 1: spacename : origin = 0x...., length 0x..
}
SECTIONS
{
.my_sect : {} >spacename PAGE 1
}
#pragma CODE_SECTION
#pragma DATA_SECTION
其中data_section是针对数据空间的,code_section是针对程序空间的,具体的使用办法是
#pragma DATA_SECTION(bufferB, ”my_sect”)
char bufferB[512];
在.cmd文件中建立对应的section就可以使用了.
MEMORY
{
PAGE 1: spacename : origin = 0x...., length 0x..
}
SECTIONS
{
.my_sect : {} >spacename PAGE 1
}
- DATA_SECTION pragma
- #pragma DATA_SECTION
- #pragma DATA_SECTION
- #pragma DATA_SECTION
- DATA_SECTION pragma
- #pragma DATA_SECTION
- The DATA_SECTION Pragma
- #pragma DATA_SECTION的解释
- #pragma DATA_SECTION DSP中的使用
- #pragma DATA_SECTION 和CMD文件
- #pragma DATA_SECTION 和CMD文件
- #pragma DATA_SECTION 和CMD文件
- #pragma DATA_SECTION 和 #pragma CODE_SECTION的使用
- #pragma DATA_SECTION 和 #pragma CODE_SECTION的使用
- #pragma DATA_SECTION与#pragma CODE_SECTION的使用
- #pragma DATA_SECTION(bufferB, ”my_sect”),分配指定内存空间
- CCS中DATA_SECTION()用法
- #pragma
- 电池供电的射频检测系统的低功耗处理
- DOS命令全集(载自百度百科)
- 对REST资源定位的两点看法
- Android开发指南-二维图形
- Visual C++ 2008两个常见问题的处理
- DATA_SECTION pragma
- 回家
- CMD命令(转自百度百科)
- VNC密码验证绕过漏洞攻击案例(2)
- OGNL表达式语言介绍
- hibernate的懒加载和查询
- 编写高效Java代码 java.lang.String类和java.util.Vector类
- 九.开发工具
- 指针(详解)