注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

眼睛想旅行

技术就是我的生命与信仰!

 
 
 

日志

 
 
关于我

精通C,C++,python,Erlang。并熟悉各种其他编程语言,用cocos2dx游戏引擎作过几个项目。会MySQL增删改查,了解OpenGL渲染原理。懂单片机,能设计数字电路系统,会画电路图和设计电路板。喜欢了解最新前沿技术,并持续关注和学习新技术。

网易考拉推荐

ADS1.2中的内建变量(转)  

2011-02-24 21:22:50|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

ARM9 SC2440和2410得初始化代码中有下面一个定义:


GBLL    THUMBCODE
   [ {CONFIG} = 16
THUMBCODE SETL  {TRUE}
         CODE32
   |
THUMBCODE SETL  {FALSE}
   ]
网上的朋友有问下面问题的,我也有疑惑,从ARM官方网站查到了答案。特此列出。

请问代码里的 {CONFIG} 代表什么含义,如何知道它是不是等于为16
是某处定义的某个变量?
还是编译的时候某个配置选项?

用{}括起来代表什么含义
CONFIG 是ADS1.2编译器内建变量,还有其他一些内建变量。

 

 


Built-in variables and constants

Table 3.3 lists the built-in variables defined by the ARM assembler.

Table 3.3. Built-in variables

{ARCHITECTURE}
 Holds the name of the ARM architecture selected by the --device option.
 
{AREANAME}
 Holds the name of the current AREA.
 
{ARMASM_VERSION}
 Holds an integer that increases with each version of armasm.
 
|ads$version|
 Has the same value as {ARMASM_VERSION}.
 
{CODESIZE}
 Is a synonym for {CONFIG}.
 
{COMMANDLINE}
 Holds the contents of the command line.
 
{CONFIG}
 Has the value 32 if the assembler is assembling ARM code, or 16 if it is assembling Thumb code.
 
{CPU}
 Holds the name of the CPU selected by the --device option.
 
{ENDIAN}
 Has the value “big” if the assembler is in big-endian mode, or “little” if it is in little-endian mode. The default value is selected by the --device option.
 
{FPU}
 Holds the name of the FPU. The default FPU name is selected by the --device option.
 
{INPUTFILE}
 Holds the name of the current source file.
 
{INTER}
 Has the boolean value True if /inter is set. The default is False.
 
{LINENUM}
 Holds an integer indicating the line number in the current source file.
 
{OPT}
 Value of the currently-set listing option. The OPT directive can be used to save the current listing option, force a change in it, or restore its original value.
 
{PC} or .
 Address of current instruction.
 
{PCSTOREOFFSET}
 Is the offset between the address of the STR pc,[…] or STM Rb,{…, pc} instruction and the value of pc stored out. This varies depending on the device specified.
 
{ROPI}
 Has the boolean value True if /ropi is set. The default is False.
 
{RWPI}
 Has the boolean value True if /rwpi is set. The default is False.
 
{VAR} or @
 Current value of the storage area location counter.
 

 

Built-in variables cannot be set using the SETA, SETL, or SETS directives. They can be used in expressions or conditions, for example:

        IF {ARCHITECTURE} = "4T"

The built-in variable |ads$version| must be all in lowercase. The names of the other built-in variables can be in uppercase, lowercase, or mixed. For example:

        IF {CpU} = "ARM7TDMI"

Note

All built-in string variables contain case-sensitive values. See CPU names for valid values for {CPU} and {ARCHITECTURE}. See FPU names for valid values for {FPU}. Relational operations on these built-in variables will not match with strings that contain an incorrect case.

Table 3.4 lists the built-in Boolean constants defined by the ARM assembler.

Table 3.4. Built-in Boolean constants

{FALSE}
 Logical constant false.
 
{TRUE}
 Logical constant true.
 


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yanglijing/archive/2009/10/17/4687173.aspx

我的网站,有兴趣的可以去看看,写点东西,给我拉拉人气:http://www.k557.com/bbs/
forum.php?gid=59

www.k557.com

www.k557.com/bbs

  评论这张
 
阅读(552)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017