当前位置:网站首页>[MIT 6.S081] Lec 5: Calling conventions and stack frames RISC-V 笔记
[MIT 6.S081] Lec 5: Calling conventions and stack frames RISC-V 笔记
2022-07-27 16:09:00 【PeakCrosser】
Lec 5: Calling conventions and stack frames RISC-V
- Ref: https://github.com/huihongxiao/MIT6.S081/tree/master/lec05-calling-conventions-and-stack-frames-risc-v
- Preparation: Calling Convention
Outline
- C -> ASM / Processors
- RISC-V & x86
- Registers
- Stack + calling conventions
- Struct Layout in memory
C -> ASM
- C -> Asm -> Bianary (.o/.obj 文件)
RISC-V & x86
- RISC-V(精简指令集)和 x86(复杂指令集)的区别:
- 指令集的数量: RISC-V 指令集更少
- RISC-V 指令的操作比 x86 更简单
- RISC 指令集开源
- RISC-V 指令集组成:
- Base Integer Instruction Set: 常用指令, 如
add,mult - Standard Extension Instruction Set: 扩展指令集
- Base Integer Instruction Set: 常用指令, 如
RISC-V Registers
- a0~a7用于函数传参, 参数超过 8 个使用该内存传参
- Saver:
- Caller: Not preserved across function call 该类型寄存器的值在函数调用期间不会保留, 即该寄存器在函数调用中可能被重写
- Callee: preserved across function call
Stack

- fp: frame ponter, 即栈帧, 相当于 x86 的 bp.
- 汇编函数 ASM Function 组成:
- Function prologue: 调整 sp, 保存返回地址 ra
- Body
- Epollgue: 将返回地址加载会 ra 寄存器, 还原 sp
边栏推荐
- js工具-cookie简单封装
- 浅论分布式训练中的recompute机制
- Golang waits for a group of goroutines to complete with the return value (2)
- 3. Opencv geometric transformation
- Guoju spent $1.8 billion to acquire its competitor KEMET, and the transaction may be completed in the second half of next year
- ts学习笔记-class
- Deep learning: Gan case exercise -minst handwritten digits
- zabbix6.0的安装部署
- 1542. 找出最长的超赞子字符串 哈希+状态压缩
- Introduction to ef framework
猜你喜欢
随机推荐
深度学习:GCN(图卷积神经网络)理论学习总结
Bubble sorting in JS
动态链表2栈的链表存储结构(LinkedStack实现)
js工具-cookie简单封装
解决Reids不能被其他IP访问
Salesforce certified sharing and visibility Designer (su20) certification examination summary
js实现页面或DOM元素平滑滚动
Golang Chan implements mutual exclusion
EF框架简介
贴牌“美国制造”,国产安防设备竟被装上了美航母!
邮件安全运营难?Coremail携手云商店打造企业邮箱办公新生态!
浅谈AI深度学习的模型训练和推理
查看端口PID及结束进程
力压谷歌、英伟达!阿里含光800芯片再获权威测试世界第一
登录页面tableLayout(表格布局)
WPF makes login interface
【云图说】 第249期 移动应用安全服务—App的体检中心,全面检测,安全上路!
Six relationships of classes -- the difference between dependency and Association
荣耀、小米发双十一战报:都称自己是冠军
What's the use of games| Game application value research case collection








![[learning notes] the implementation principle of the ordered set Zset in redis - skip table](/img/c6/5d9f48fce1dc1c78b8c7dbcf046fc7.png)
