当前位置:网站首页>[mit 6.s081] LEC 5: calling conventions and stack frames risc-v notes
[mit 6.s081] LEC 5: calling conventions and stack frames risc-v notes
2022-07-27 18:27: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 file )
RISC-V & x86
- RISC-V( Reduced instruction set ) and x86( Complex instruction set ) The difference between :
- Number of instruction sets : RISC-V Fewer instruction sets
- RISC-V The operation ratio of instructions x86 It's simpler
- RISC Instruction set open source
- RISC-V Instruction set composition :
- Base Integer Instruction Set: Commonly used instructions , Such as
add,mult - Standard Extension Instruction Set: Extended instruction set
- Base Integer Instruction Set: Commonly used instructions , Such as
RISC-V Registers
- a0~a7 Used to pass parameters to functions , The parameter exceeds 8 Use this memory to transfer parameters
- Saver:
- Caller: Not preserved across function call The value of this type of register will not be retained during the function call , That is, the register may be rewritten in the function call
- Callee: preserved across function call
Stack

- fp: frame ponter, Stack frame , amount to x86 Of bp.
- Assembly function ASM Function form :
- Function prologue: adjustment sp, Save return address ra
- Body
- Epollgue: Load the return address ra register , Restore sp
边栏推荐
- 【学习笔记】Redis中有序集合zset的实现原理——跳表
- Software installation related
- 华为Mate30 Pro 5G拆解:自研芯片占比过半,美系芯片依然存在!
- [learning notes] classification of locks in the database
- Disassembly of Xiaomi cc9 Pro: the cost of rear five shots is several times that of Xiaolong 855!
- 收藏!0 基础开源数据可视化平台 FlyFish 大屏开发指南
- [MIT 6.S081] Lab8: locks
- 力压谷歌、英伟达!阿里含光800芯片再获权威测试世界第一
- Golang Chan implements mutual exclusion
- [MIT 6.S081] Lab 3: page tables
猜你喜欢
![[MIT 6.S081] Lab 11: networking](/img/9d/cca59a662412f3c3c57c26c5987a24.png)
[MIT 6.S081] Lab 11: networking

解决Reids不能被其他IP访问
![[MIT 6.S081] Lab 6: Copy-on-Write Fork for xv6](/img/ca/e8c0827b13805c7c74cc41bf84c6ff.png)
[MIT 6.S081] Lab 6: Copy-on-Write Fork for xv6

Super practical! After reading the kubernetes study notes hidden by Alibaba P9, call NB directly
![[MIT 6.S081] Lab 3: page tables](/img/ea/94cdb4379733994adf3aa31cf2e826.png)
[MIT 6.S081] Lab 3: page tables

Getting started with typora: the most complete tutorial in the whole network
![[MIT 6.S081] Lab 5: xv6 lazy page allocation](/img/f6/8b619412bc6ba425d0f04629917e80.png)
[MIT 6.S081] Lab 5: xv6 lazy page allocation
![[MIT 6.S081] Lab 7: Multithreading](/img/f4/26e513fb8678a88cfba29c1a636b37.png)
[MIT 6.S081] Lab 7: Multithreading

【学习笔记】Redis中有序集合zset的实现原理——跳表

深度学习-视频行为识别:论文阅读——双流网络(Two-stream convolutional networks for action recognition in videos)
随机推荐
Year end summary template
You can't specify target table 'table name' for update in from clause error resolution in MySQL
Add music to the program interface and load background photos.
给程序界面增加音乐,加载背景照片。
On recommend mechanism in distributed training
3. opencv几何变换
[MIT 6.S081] Lab 7: Multithreading
深度学习:GCN(图卷积神经网络)理论学习总结
Nowcoder (5 choices)
贴牌“美国制造”,国产安防设备竟被装上了美航母!
Jrs-303 usage
Marvell announced the roadmap of its arm server chip, and the performance of the next generation will be twice that of thunderx2
Deep learning - paper reading: action structural graph convolution network as-gcn
Intel releases a new generation of movidius Vpu: 10 times higher performance and 30W power consumption
Backup table recovery table
深度学习-视频行为识别:论文阅读——双流网络(Two-stream convolutional networks for action recognition in videos)
[MIT 6.S081] Lab 9: file system
[MIT 6.S081] Lab 3: page tables
Please ask the great God a question, flinkcdc, the datetime field in synchronous MySQL will become a timestamp. Has anyone ever encountered it
Dynamic linked list 4 one-way circular linked list (loopsingle Implementation)