当前位置:网站首页>[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
边栏推荐
- Bubble sorting in JS
- 施耐德电气、欧莱雅等企业巨头如何开放式创新?DEMO WORLD世界创新峰会揭秘
- [learning notes] advanced version of MySQL database - index optimization, slow query, locking mechanism, etc
- 查看端口PID及结束进程
- You can't specify target table 'table name' for update in from clause error resolution in MySQL
- XStream reports an error abstractreflectionconverter$unknownfield exception when parsing XML
- Add music to the program interface and load background photos.
- 英特尔发布新一代Movidius VPU:性能提升10倍,功耗仅30W
- 数据库的常用命令2
- 深度学习:安装包记录
猜你喜欢

Salesforce runs all test classes and gets coverage reports

CFA exam registration instructions

VSS tip: search all checked out files (search checked out files according to users)

The latest advanced interview questions for big factories are necessary

3. opencv几何变换

Six relationships of classes -- the difference between dependency and Association

Deep learning: GCN (graph convolution neural network) theory learning summary

Salesforce File Share and Security

解决Reids不能被其他IP访问

Interview FAQs 12
随机推荐
文件路径读取
数据库的常用命令1
What every Salesforce developer should know about Dates and Times in Apex
动态链表4单向循环链表(LoopSingle实现)
MySql代码数据库创建 停车管理系统 外键
zabbix6.0的安装部署
深度学习:行为识别综述
canvas根据坐标点绘制图形
js工具-cookie简单封装
Mysql四种锁
View port PID and end process
Deep learning: installation package records
Exciting collection of new features released by salesforce
邮件安全运营难?Coremail携手云商店打造企业邮箱办公新生态!
Add music to the program interface and load background photos.
Is it difficult to operate email safely? COREMAIL joins hands with cloud store to create a new ecosystem of corporate email office!
小米CC9 Pro拆解:后置五摄成本是骁龙855数倍!
江苏华存首发PCIe 5.0 SSD主控:台积电12nm工艺,2020年量产
Buffer的只读模式
深度识别:论文阅读_2S-AGCN CVPR2019(基于骨架的动作识别的两流自适应图卷积网络)