keil 里LPC11序列C程序能指定变量/函数的绝对地址吗?如何指定?

2019-03-25 20:29发布

:carnation: 我知道KEIL C51是可以的。
这个用于有时候程序分开几部分开发,或者打补丁 [ 本帖最后由 oayzw 于 2012-7-19 09:08 编辑 ] 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
4条回答
oayzw
2019-03-26 04:11
是指这些“#pragma arm section ...”吧?

http://www.keil.com/support/man/ ... mccref_BCFJBABB.htm

Example

int x1 = 5;                     // in .data (default)
int y1[100];                    // in .bss (default)
int const z1[3] = {1,2,3};      // in .constdata (default)
#pragma arm section rwdata = "foo", rodata = "bar"
int x2 = 5;                     // in foo (data part of region)
int y2[100];                    // in .bss
int const z2[3] = {1,2,3};      // in bar
char *s2 = "abc";               // s2 in foo, "abc" in .conststring
#pragma arm section rodata
int x3 = 5;                     // in foo
int y3[100];                    // in .bss
int const z3[3] = {1,2,3};      // in .constdata
char *s3 = "abc";               // s3 in foo, "abc" in .conststring
#pragma arm section code = "foo"
int add1(int x)                   // in foo (code part of region)
{
    return x+1;
}
#pragma arm section code

一周热门 更多>