How to locate a string at the top end of the ROM?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to locate a string at the top end of the ROM?

697 次查看
NeilVP
Contributor II

Is there a means by which I can instruct the compiler to find out how much ROM there is available in the particular microcontroller being used so that I can then place a string at the top of memory minus the length of the string - rather than finding this out manually each time? 

 

Many thanks

 

Neil

标签 (1)
0 项奖励
回复
1 回复

398 次查看
Jim_P
Contributor III

I got this from a different question but might answer your question

 

this allows the code to know where the segment boundaries are.

 

To get start or end of segment use linker defined symbols __SEG_START_xxx, __SEG_END_xxx, __SEG_SIZE_xxx, where xxx is placement. You need to declare those linker defined symbols in your code like

   extern int __SEG_START_xxx[];

 

In case data has to be not initialized, change type of segment in prm from READ_WRITE or READ_ONLY to NO_INIT .

 
see help in CW   Linker-Defined Objects

0 项奖励
回复