新聞中心

EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > arm 變量或數(shù)組放置在指定地址

arm 變量或數(shù)組放置在指定地址

作者: 時(shí)間:2016-11-20 來(lái)源:網(wǎng)絡(luò) 收藏

語(yǔ)法

__attribute__((at(address)))

其中:

本文引用地址:http://2s4d.com/article/201611/319040.htm
address

是所需的變量地址。

限制

鏈接器并非始終能夠放置 at 變量屬性生成的節(jié)。

錯(cuò)誤

如果無(wú)法將節(jié)放置在指定地址,鏈接器將顯示一條錯(cuò)誤消息。

示例

const int x1 __attribute__((at(0x10000))) = 10; int x2 __attribute__((at(0x12000))) = 10; int x3 __attribute__((at(0x14000))) = 0; int x4 __attribute__((at(0x16000)));

另請(qǐng)參閱

uint32constEnCode__attribute__((at(0x1FC)))=0x87654321;

或者加入:

#include
const char MyText[] __at (0x1F00) = "TEXT AT ADDRESS 0x1F00";



關(guān)鍵詞: arm變量數(shù)組指定地

評(píng)論


技術(shù)專區(qū)

關(guān)閉