我是靠谱客的博主 娇气巨人,最近开发中收集的这篇文章主要介绍ARM 多寄存器寻址 (块拷贝寻址),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

LDM/LDMIA/LDMFD

Load Multiple Increment After (Load Multiple Full Descending) loads multiple registers from consecutive memory
locations using an address from a base register. The consecutive memory locations start at this address, and the
address just above the highest of those locations can optionally be written back to the base register.

上面三者都是 LDM 指令,名字不同而已。LDMFD 通常在从满减栈中 pop 数据的场合使用。

LDM sp!, {R1-R7} // pop {R1-R7}
The lowest-numbered register is loaded from the lowest memory address,
through to the highest-numbered register from the highest memory address.
低地址的数据加载到标号小的寄存器,高地址的数据加载到标号大的寄存器。

LDMIA R0!, {R1, R2, R3}  -->  addr=R0, R1 = [addr], R2 = [addr+4], R3 = [addr+8], R0 = R0+12

在这里插入图片描述

LDMIB/LDMED

Load Multiple Increment Before (Load Multiple Empty Descending) loads multiple registers from consecutive
memory locations using an address from a base register. The consecutive memory locations start just above this
address, and the address of the last of those locations can optionally be written back to the base register.

LDMED 通常用在空减栈中 pop 数据的场合使用。

LDMED R0!, {R1, R2, R3}  -->  addr = R0+4, R1 = [addr], R2 = [addr+4], R3 = [addr+8], R0 = R0+12

在这里插入图片描述

LDMDA/LDMFA

Load Multiple Decrement After (Load Multiple Full Ascending) loads multiple registers from consecutive memory
locations using an address from a base register. The consecutive memory locations end at this address, and the
address just below the lowest of those locations can optionally be written back to the base register.

与上面的区别是地址先减一个偏移再取数。LDMFA 通常用在满增栈中 pop 数据的场合使用。

LDMDA R0!, {R1, R2, R3}  -->  addr = R0-8, R1 = [addr], R2 = [addr+4], R3 = [addr+8], R0 = R0-12

在这里插入图片描述

LDMDB/LDMEA

Load Multiple Decrement Before (Load Multiple Empty Ascending) loads multiple registers from consecutive
memory locations using an address from a base register. The consecutive memory locations end just below this
address, and the address of the lowest of those locations can optionally be written back to the base register.

在这里插入图片描述

LDMEA 通常用在空增栈中 pop 数据的场合使用。

LDMDA R0!, {R1, R2, R3}  -->  addr = R0-12, R1 = [addr], R2 = [addr+4], R3 = [addr+8], R0 = R0-12

最后

以上就是娇气巨人为你收集整理的ARM 多寄存器寻址 (块拷贝寻址)的全部内容,希望文章能够帮你解决ARM 多寄存器寻址 (块拷贝寻址)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部