ARM A32多数据处理汇编指令理解分享
- 1 多数据存储指令
- 1.1 push指令
- 1.2 STMFD/STMDB指令
- 1.3 STMED/STMDA指令
- 1.4 STMFA/STMIB指令
- 1.5 STMEA/STMIA指令
- 2 多数据加载指令
- 2.1 pop指令
- 2.2 LDMFD/LDMIA指令
- 2.3 LDMFA/LDMDA指令
- 2.4 LDMEA/LDMDB指令
- 2.5 LDMED/LDMIB指令
在ARM A32多数据处理汇编指令分为多数据存储指令和多数据加载指令:
1,多数据存储指令:push, STMFD(STMDB), STMED(STMDA) , STMFA(STMIB), STMEA(STMIA);
2,多数据加载指令:pop,LDMF(LDMIA), LDMFA(LDMDA), LDMEA(LDMDB), LDMED(LDMIB);
1 多数据存储指令
多数据存储指令:push, STMFD(STMDB), STMED(STMDA) , STMFA(STMIB), STMEA(STMIA);
1.1 push指令
Push multiple registers to Stack stores multiple general-purpose registers to the stack, storing to consecutive memory locations ending just below the address in SP, and updates SP to point to the start of the stored data.
将多个寄存器压入栈(Push multiple registers to stack)会将多个通用寄存器保存到栈中,保存到连续的内存位置,结束地址位于栈指针(SP)所指向地址的下方,并且更新栈指针(SP)到已存储数据的起始位置。
This instruction is an alias of the STMDB
, STMFD
instruction.
该指令是 STMDB
、STMFD
指令的别名。
指令执行的结果示意图如下所示:
1.2 STMFD/STMDB指令
Store Multiple Decrement Before (Full Descending) stores multiple registers to consecutive memory locations using an address from a base register. The consecutive memory locations end just below this address, and the address of the first of those locations can optionally be written back to the base register.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
1.3 STMED/STMDA指令
Store Multiple Decrement After (Empty Descending) stores multiple registers to 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.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
1.4 STMFA/STMIB指令
Store Multiple Increment Before (Full Ascending) stores multiple registers to 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.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
1.5 STMEA/STMIA指令
Store Multiple (Increment After, Empty Ascending) stores multiple registers to consecutive memory locations using an address from a base register. The consecutive memory locations start at this address, and the address just above the last of those locations can optionally be written back to the base register.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
2 多数据加载指令
多数据加载指令:pop,LDMF(LDMIA), LDMFA(LDMDA), LDMEA(LDMDB), LDMED(LDMIB);
2.1 pop指令
Pop Multiple Registers from Stack loads multiple general-purpose registers from the stack, loading from consecutive memory locations starting at the address in SP, and updates SP to point just above the loaded data.
This instruction is an alias of the LDM, LDMIA, LDMFD instruction.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
2.2 LDMFD/LDMIA指令
Load Multiple (Increment After, 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.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
2.3 LDMFA/LDMDA指令
Load Multiple Decrement After (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.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
2.4 LDMEA/LDMDB指令
Load Multiple Decrement Before (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.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图:
2.5 LDMED/LDMIB指令
Load Multiple Increment Before (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.
The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address.
该数据存储指令的格式:
该数据存储指令执行简易示意图: