DSP 的C语言中如何定义一个绝对地址的变量

[复制链接]
6319|4
 楼主| MicroMMU 发表于 2007-8-15 17:21 | 显示全部楼层 |阅读模式
在51中可用如<br /><br />unsigned&nbsp;char&nbsp;xdata&nbsp;&nbsp;LedOutputAdrr&nbsp;_at_0x1234;<br />unsigned&nbsp;char&nbsp;code&nbsp;&nbsp;&nbsp;LedOutputAdrr&nbsp;_at_0x1234;<br /><br />请教在CCS中如何定义类上面的地址。
alleluia 发表于 2007-8-15 21:52 | 显示全部楼层

volatile unsigned char *pChar = (unsigned char *)0x1234;

  
wowow 发表于 2007-8-16 17:50 | 显示全部楼层

貌似只能给section绝对定位

一般要绝对定位的变量也不多,可以放在一个或多个自己命名的Section里,然后在cmd文件中给这些section分配地址。查查#pragma&nbsp;DATA_SECTION的用法
 楼主| MicroMMU 发表于 2007-8-17 01:47 | 显示全部楼层

volatile unsigned char *pChar = (unsigned char *)0x1234;

DSP里有3个存贮区:<br />volatile&nbsp;unsigned&nbsp;char&nbsp;*pChar&nbsp;=&nbsp;(unsigned&nbsp;char&nbsp;*)0x1234;<br />到底是对哪个存贮区的操作。<br />51可以用&nbsp;Xdata&nbsp;code来区分。<br />
chen3bing 发表于 2007-8-17 18:34 | 显示全部楼层

RE

数据空间吧.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

73

主题

531

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部