现在的位置: 首页 > 综合 > 正文

ADS ARM Assembler内置变量

2013年10月21日 ⁄ 综合 ⁄ 共 1198字 ⁄ 字号 评论关闭

下表列出了ARM汇编器定义的内置变量。(引自Assembler Guide第三章 汇编参考)

变量名称

含义

{PC} or .

当前指令的地址

{VAR} or @

存储区位置计数器当前值

{TRUE}

逻辑常量“真”

{FALSE}

逻辑常量“假”

{OPT}

当前设置的列表选项值。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.)

{CONFIG}

如果要汇编成ARM指令则值为32,如果要汇编成THUMB指令则值为16。

{ENDIAN}

如果汇编器是大端模式则值为大,如果是小端模式则值为小。

{CODESIZE}

{CONFIG}的同义词

{CPU}

保存选择的CPU名称。默认是ARM7TDMI。如果在命令行 –cpu option指定一个(CPU)架构 ,则{CPU}保存 "Generic ARM".。

{FPU}

保存选择的fpu名称。默认是SoftVFP.

{ARCHITECTURE}

保存选择的ARM架构。

{PCSTOREOFFSET}

Is the offset between the address of the STR爌c,[...] or STM燫b,{...,爌c} instruction and the value of pc stored out. This varies depending on the CPU or architecture specified.

{ARMASM_VERSION}

Holds an integer that increases with each version. See also Determining the armasm version at assembly time

|ads$version|

与{ARMASM_VERSION}值相同

{INTER}

Has the value True if /inter is set. The default is False.

{ROPI}

Has the value True if /ropi is set. The default is False.

{RWPI}

Has the value True if /rwpi is set. The default is False.

{SWST}

Has the value True if /swst is set. The default is False.

{NOSWST}

Has the value True if /noswst is set. The default is False.

 

 

内置变量不能用SETA,SETL或SETS指令赋值。它们可以用在表达式或条件中,例如:

IF {ARCHITECTURE}=“4T”

|ads$version|必须全部用小写。其它的内置变量可以是大写,小写或者混合的。

抱歉!评论已关闭.