23.10.2014 Views

RealView - ARM Information Center

RealView - ARM Information Center

RealView - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

命 令 参 考<br />

7.7.6 EQU<br />

EQU 命 令 为 一 个 数 值 常 数 、 相 对 寄 存 器 的 值 或 相 对 程 序 的 值 给 定 一 个 符 号 名 。<br />

* 是 EQU 的 一 个 同 义 词 。<br />

语 法<br />

name EQU expr{, type}<br />

其 中 :<br />

name 是 要 为 值 指 定 的 符 号 名 称 。<br />

expr<br />

是 一 个 相 对 寄 存 器 的 地 址 、 相 对 程 序 的 地 址 、 绝 对 地 址 或 32 位 整<br />

型 常 数 。<br />

type 是 可 选 的 。 type 可 以 是 下 列 值 之 一 :<br />

• CODE16<br />

• CODE32<br />

• DATA<br />

只 有 当 expr 是 一 个 绝 对 地 址 时 , 才 能 使 用 type。 如 果 导 出 name, 那<br />

么 根 据 type 的 值 , 目 标 文 件 的 符 号 表 中 的 name 条 目 将 被 标 记 为<br />

CODE16、 CODE32 或 DATA。 这 些 信 息 可 由 链 接 程 序 使 用 。<br />

用 法<br />

使 用 EQU 定 义 常 数 。 这 类 似 于 在 C 中 使 用 #define 定 义 常 数 。<br />

有 关 导 出 符 号 的 信 息 , 请 参 阅 第 7-67 页 的 KEEP 和 第 7-61 页 的 EXPORT 或<br />

GLOBAL。<br />

示 例<br />

abc EQU 2<br />

xyz EQU label+8<br />

fiq EQU 0x1C, CODE32<br />

; assigns the value 2 to the symbol abc.<br />

; assigns the address (label+8) to the<br />

; symbol xyz.<br />

; assigns the absolute address 0x1C to<br />

; the symbol fiq, and marks it as code<br />

7-60 © 2002、 2003 <strong>ARM</strong> Limited 版 权 所 有 。 保 留 所 有 权 利 。 <strong>ARM</strong> DUI 0204BSC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!