转自:http://blog.csdn.net/yanglijing/article/details/4687173
ARM9 SC2440和2410得初始化代码中有下面一个定义:
[ {CONFIG} = 16
THUMBCODE SETL {TRUE}
CODE32
|
THUMBCODE SETL {FALSE}
]
请问代码里的 {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. |
注:一下部分转自:http://826891.blog.163.com/blog/static/8637693201071153746643/
{CONFIG} 是ARM 汇编器的内置变量,其不能通过SETA,SETL或SETS等指示符来设置,只能用表达式或条件来设置。内置变量介绍如下:
内置变量 变量含义
{PC}或. 当前指令的地址
{VAR}或@ 存储区位置计数器的当前值
{TRUE} 逻辑常量真
{FALSE} 逻辑常量假
{OPT} 当前设置列表选项值,OPT用来保存当前列表选
项,改变选项值,恢复它的原始值
{CONFIG} 如果汇编器汇编ARM代码,则值为32;如果汇编器
汇编Thumb代码,则值为16
{ENDIAN} 如果汇编器在大端模式下,则值为big;如果汇编器
在小端模式下,则值为little
{CODESIZE} 如果汇编器汇编ARM代码,则值为32;如果汇编器
汇编Thumb代码,则值为16,与{CONFIG}同义
{CPU} 选定的CPU名,缺省时为ARM7TDMI
{FPU} 选定的FPU名,缺省时为SoftVFP
{ARCHITECTURE} 选定的ARM体系结构的值;3,3M,4,4T和4TxM
{PCSTOREOFFSET} STR pc,[…]或STMRb,[…PC]指令的地址和PC存
储值之间的偏移量
{ARMASM_VERSION} ARM汇编器的版本号,为整数
或| ads $ version |