当前位置:网站首页>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。
边栏推荐
- 同花顺是正规平台吗?同花顺开户安全吗
- Chrysanthemum chain (winter vacation daily question 39)
- Convert string array to list collection
- Qt中使用QDomDocument操作XML文件
- DDD概念复杂难懂,实际落地如何设计代码实现模型?
- [mobile terminal] design size of mobile phone interface
- Please run IDA with elevated permissons for local debugging.
- 【Proteus仿真】Arduino UNO+继电器控制照明设备
- 1-6搭建Win7虚拟机环境
- Build and train your own dataset for pig face recognition
猜你喜欢
Cusdis - lightweight, privacy first open source comment system | chain of the city

记一次beego通过go get命令后找不到bee.exe的坑

数据库系统概论必背知识

1-6搭建Win7虚拟机环境

探索C语言程序奥秘——C语言程序编译与预处理

TSDB在民机行业中的应用

Test / development programmers, 30, do you feel confused? And where to go

罗德与施瓦茨与中关村泛联院合作开展6G技术研究与早期验证

random list随机生成不重复数

yarn : 无法加载文件 C:\Users\xxx\AppData\Roaming\npm\yarn.ps1,因为在此系统上禁止运行脚本
随机推荐
Half of the year has passed. How many flags have been achieved at the end of the year?
Can automate - 10k, can automate - 20K, do you understand automated testing?
vim的Dirvish中文文档
文件系统 -- 磁盘基础知识和FAT32文件系统详细介绍
Beescms website penetration test and repair comments "suggestions collection"
会自动化—10K,能做自动化—20K,你搞懂自动化测试没有?
The role of software security testing, how to find a software security testing company to issue a report?
Logminer database log mining
Please run IDA with elevated permissons for local debugging.
When they are in private, they have a sense of propriety
折叠屏将成国产手机分食苹果市场的重要武器
Post competition summary of kaggle patent matching competition
jwt
保险APP适老化服务评测分析2022第06期
把 Oracle 数据库从 Windows 系统迁移到 Linux Oracle Rac 集群环境(4)—— 修改 oracle11g rac 集群的 scanIP
左手梦想 右手责任 广汽本田不光关注销量 还有儿童安全
jwt
How to get the picture outside the chain - Netease photo album [easy to understand]
【STL源码剖析】配置器(待补充)
Test / development programmers, 30, do you feel confused? And where to go