23.10.2014 Views

RealView - ARM Information Center

RealView - ARM Information Center

RealView - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ARM</strong> 指 令 参 考<br />

Rm 是 一 个 寄 存 器 , 包 含 要 用 作 偏 移 量 的 一 个 值 。<br />

偏 移 量 语 法 与 第 4-17 页 的 LDR 和 STR, 双 字 相 同 。<br />

半 字 传 送 时 的 地 址 对 齐<br />

对 于 半 字 传 送 , 地 址 必 须 是 偶 数 。<br />

如 果 系 统 含 有 系 统 协 处 理 器 (cp15), 则 可 以 启 用 对 齐 检 查 。 如 果 启 用 了 对 齐 检<br />

查 , 那 么 非 半 字 对 齐 的 16 位 传 送 将 导 致 对 齐 异 常 。<br />

如 果 系 统 没 有 系 统 协 处 理 器 (cp15), 或 者 禁 用 了 对 齐 检 查 :<br />

• 非 半 字 对 齐 的 16 位 装 载 会 破 坏 Rd ;<br />

• 非 半 字 对 齐 的 16 位 装 载 会 破 坏 位 于 [address] 和 [address-1] 处 的 两 个 字 节 。<br />

装 载 到 r15 中<br />

不 能 将 半 字 或 字 节 装 入 到 r15 中 。<br />

体 系 结 构<br />

这 些 指 令 可 用 在 v2 及 以 上 版 本 的 体 系 结 构 中 。<br />

示 例<br />

LDREQSH r11,[r6]<br />

; (conditionally) loads r11 with a 16-bit halfword<br />

; from the address in r6. Sign extends to 32 bits.<br />

LDRH r1,[r0,#22] ; load r1 with a 16 bit halfword from 22 bytes<br />

; above the address in r0. Zero extend to 32 bits.<br />

STRH r4,[r0,r1]! ; store the least significant halfword from r4<br />

; to two bytes at an address equal to contents(r0)<br />

; plus contents(r1). Write address back into r0.<br />

LDRSB r6,constf ; load a byte located at label constf. Sign extend.<br />

不 正 确 的 示 例<br />

LDRSB r1,[r6],r3,LSL#4 ; This format is only available for word and<br />

; unsigned byte transfers.<br />

4-16 © 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!