变量定义之 "extern far"

本文深入探讨了在C6000系列处理器的编译器中使用'extern far'关键字的重要性,解释了'extern'和'far'关键字的作用,以及它们如何确保正确访问全局变量。通过实例分析和链接到相关资源,为开发者提供了全面理解这一关键概念的指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 In order for the code in file.c to access ary correctly, it must be  defined as ’extern far’

’extern’ informs the compiler that ary is defined in some other file. 

’far’ informs the compiler that ary is accessible via the data page pointer. 

If the ’far’ keyword is  missing, then the compiler will incorrectly assume that ary is in .bss and can be accessed via the data page pointer. 

extern far in ary;

更多 far 关键字相关可参考: http://blog.youkuaiyun.com/kissmonx/article/details/8125196

或者官方的 TMS320C6000 Optimizing Compiler v 7.4 User's Guide.pdf



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值