当前位置:网站首页>arm push/pop/b/bl汇编指令
arm push/pop/b/bl汇编指令
2022-08-02 14:08:00 【nginux】
目录
1. push指令
- 功能描述:入栈
armv7 芯片手册:
Push Multiple Registers stores multiple 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.
- 语法
Assembler syntax
PUSH{<c>}{<q>} <registers> Standard syntax
STMDB{<c>}{<q>} SP!, <registers> Equivalent STM syntax
where:
<c>, <q> See Standard assembler syntax fields on page A8-285.
<registers> Is a list of one or more registers to be stored, separated by commas and surrounded by { and }. The lowest-numbered register is stored to the lowest memory address, through to the highest-numbered register to the highest memory address. See also Encoding of lists of ARM core registers on page A8-292.
If the list contains more than one register, the instruction is assembled to encoding T1, T2, or A1. If the list contains exactly one register, the instruction is assembled to encoding T1, T3, or A2. The SP and PC can be in the list in ARM instructions, but not in Thumb instructions. However:
• ARM deprecates the use of ARM instructions that include the PC in the list
• if the SP is in the list, and it is not the lowest-numbered register in the list, the instruction
stores an UNKNOWN value for the SP.
push支持同时将多个寄存器入栈,格式:{xx,xx},如:push {r0, r1,r2}
2. pop指令
- 功能描述:出栈
Pop Multiple Registers loads multiple 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.
- 语法
POP{<c>}{<q>} <registers> Standard syntax
LDM{<c>}{<q>} SP!, <registers> Equivalent LDM syntax<registers> Is a list of one or more registers to be loaded, separated by commas and surrounded by { and }. The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address
如同push一样,pop也支持同时pop出栈多个寄存器
3. b指令
- 功能描述:
Branch causes a branch to a target address.
- 语法:只是简单的跳转到label处
B{<c>}{<q>} <label>
4. bl指令
- 功能描述:
Branch with Link calls a subroutine at a PC-relative address.
Branch with Link and Exchange Instruction Sets (immediate) calls a subroutine at a PC-relative address, and changes instruction set from ARM to Thumb, or from Thumb to ARM.
- 语法:
BL{X}{<c>}{<q>} <label>
The label of the instruction that is to be branched to.
For BL (encodings T1, A1), the assembler calculates the required value of the offset from the PC value of the BL instruction to this label, then selects an encoding that sets imm32 to that offset. Permitted offsets are even numbers in the range –16777216 to 16777214 (Thumb) or multiples of 4 in the range –33554432 to 33554428 (ARM).BL指令于B指令区别:
BL函数条跳转前执行:LR = PC - 4; (armv7为例)
Note: bl指令会计算label和当前pc位置的offset,所以这是相对跳转
5. bx指令
- 功能描述:跳转到寄存器中的地址
Branch and Exchange causes a branch to an address and instruction set specified by a register.
- 语法
BX{<c>}{<q>} <Rm>
The register that contains the branch target address and instruction set selection bit. The PC can be used. This register can be the SP in both ARM and Thumb instructions, but ARM deprecates this use of the SP.
边栏推荐
猜你喜欢
PyTorch⑥---卷积神经网络_池化层
It is not allowed to subscribe with a(n) xxx multiple times.Please create a fresh instance of xxx
PyTorch①---加载数据、tensorboard的使用
What?It's 2020, you still can't adapt the screen?
spark on yarn
ConstraintLayout从入门到放弃
利用红外-可见光图像数据集OTCBVS打通图像融合、目标检测和目标跟踪
Tensorflow常用函数
PyTorch⑩---卷积神经网络_一个小的神经网络搭建
Ehcache基础学习
随机推荐
MySQL知识总结 (十一) MySql 日志,数据备份,数据恢复
投资组合理论的简单介绍
数据乱码问题—更改mysql字符编码
PyTorch⑤---卷积神经网络_卷积层
预训练模型 Bert
基于深度学习的配准框架
LLVM系列第二十六章:理解LLVMContext
关于spark
LLVM系列第六章:函数返回值Return
内存申请(malloc)和释放(free)之上篇
使用flutter小记
kotlin Android序列化
LLVM系列第十章:控制流语句if-else-phi
内存申请(malloc)和释放(free)之下篇
App signature in flutter
PyTorch④---DataLoader的使用
使用预训练语言模型进行文本生成的常用微调策略
神经网络可以解决一切问题吗:一场知乎辩论的整理
PyTorch①---加载数据、tensorboard的使用
PyTorch(12)---损失函数和反向传播