当前位置:网站首页>[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
边栏推荐
- 1542. Find the longest super substring hash + state compression
- 超实用!阿里P9私藏的Kubernetes学习笔记,看完直呼NB
- Exciting collection of new features released by salesforce
- Three consecutive high-frequency interview questions of redis online celebrity: cache penetration? Cache breakdown? Cache avalanche?
- 动态链表4单向循环链表(LoopSingle实现)
- Salesforce certified sharing and visibility Designer (su20) certification examination summary
- Guoju spent $1.8 billion to acquire its competitor KEMET, and the transaction may be completed in the second half of next year
- Year end summary template
- 数据库的常用命令2
- How do corporate giants such as Schneider Electric and L'Oreal make open innovation? Uncover secrets of demo World Innovation Summit
猜你喜欢
随机推荐
js工具-cookie简单封装
Deep learning: Gan case exercise -minst handwritten digits
Golang worker pool
OEM "made in the United States", domestic security equipment has been installed on the U.S. aircraft carrier!
Salesforce File Share and Security
VSS tip: search all checked out files (search checked out files according to users)
Disassembly of Xiaomi cc9 Pro: the cost of rear five shots is several times that of Xiaolong 855!
深度学习:STGCN学习笔记
JS中的冒泡排序
Hutool digital computing
软件安装相关
技术分享| 快对讲综合调度系统
Class not found: “com.parkManagement.dao.DaoTest 测试找不到测试类
On model training and reasoning of AI deep learning
XStream reports an error abstractreflectionconverter$unknownfield exception when parsing XML
携手三星,vivo将推Exynos980双模5G手机!
Mysql四种锁
Technology sharing | quick intercom integrated dispatching system
Hackers use lasers to attack, and voice assistants can be activated from a distance of 100 meters
View port PID and end process









