当前位置:网站首页>ARM汇编中的栈桢小结
ARM汇编中的栈桢小结
2022-06-24 22:57:00 【华为云】
栈帧是什么东西?
1.栈是一种具有后进先出的数据组织方式,也就是说后存放的先取出,先存放的后取出。栈底是第一个进栈的数据所处位置,栈顶是最后一个数据进栈所处的位置。

栈帧(stack frame):就是一个函数所使用的那部分栈,所有函数的栈帧串起来就组成了一个完整的栈。栈帧的两个边界分别由fp(r11)和sp(r13)来限定。
栈帧是如何形成的呢? 当栈顶指针 sp小于栈底指针 fp时, 就形成了栈帧。
栈帧在函数中的使用?
ARM压栈的顺序很是规矩,依次为当前函数指针PC、返回指针LR、栈指针SP、栈基址FP、传入参数个数及指针、本地变量和临时变量。
ARM进行函数内压栈和出栈往往使用如下的语句:
stmfd sp!,{r0-r9, lr} ; 满递减入栈,给寄存器r0-r9,lr压栈,sp不断减4。
ldmfd sp!,{r0-r9, pc} ; 满递减出栈,给寄存器r0-r9出栈,并使程序跳转回函数的调用点,sp不断增4。
边栏推荐
- How to get the picture outside the chain - Netease photo album [easy to understand]
- Redistemplate operates redis. This article is enough (I) [easy to understand]
- 内网学习笔记(7)
- Application of TSDB in civil aircraft industry
- LINQ query (3)
- jwt
- PE文件基础结构梳理
- Please run IDA with elevated permissons for local debugging.
- Pit entry machine learning: I. Introduction
- 华泰证券如何开户能做到万分之一?证券开户安全可靠吗
猜你喜欢

消息称一加将很快更新TWS耳塞、智能手表和手环产品线

【FPGA】串口以命令控制温度采集

进入阿里做测试员遥不可及?这里或许有你想要的答案

ProcessOn制作ER过程(自定义)

Processon producer process (customized)

yarn : 无法加载文件 C:\Users\xxx\AppData\Roaming\npm\yarn.ps1,因为在此系统上禁止运行脚本

DDD概念复杂难懂,实际落地如何设计代码实现模型?

AI服装生成,帮你完成服装设计的最后一步

random list随机生成不重复数

Exploring the mystery of C language program -- C language program compilation and preprocessing
随机推荐
How can Huatai Securities open an account to achieve one in ten thousand? Are securities accounts safe and reliable
一线城市软件测试工资——你拖后腿了吗
Four characteristics of actual attack and defense drill
【FPGA】串口以命令控制温度采集
Android Internet of things application development (smart Park) - set sensor threshold dialog interface
数据库系统概论必背知识
常用的软件测试工具清单,请查收。
psql 列转行
目录权限错误导致 Oracle 11g rac 集群数据库无法启动的问题
Logminer database log mining
【Proteus仿真】Arduino UNO+数码管显示4x4键盘矩阵按键
Once beego failed to find bee after passing the go get command Exe's pit
[live review] battle code pioneer phase 7: how third-party application developers contribute to open source
算力服务网络:一场多元融合的系统革命
Folding screen will become an important weapon for domestic mobile phones to share the apple market
【移动端】手机界面的设计尺寸
Intranet learning notes (5)
Hashcat 的使用
Chrysanthemum chain (winter vacation daily question 39)
多模态情感识别_多模态融合的情感识别研究「建议收藏」