Pointers in RISC-V Assembly
Ғылым және технология
In this video, we translate a C program to RISC-V assembly to demonstrate how pointers are declared and referenced. We also use base instructions to set memory locations.
---
Timestamps:
00:00 Intro
00:51 RISC-V Simulator
01:33 C Source
02:27 Compiler Optimizations
03:12 Writing ASM by Hand
04:35 32 Bit ISA
05:42 Base Instructions vs Psuedoinstructions
06:30 Load Upper Immediate
08:46 Setting Pointer
10:17 Testing Program
13:38 Dereferencing Pointer
15:40 Store Word Benefits
16:26 Testing Dereference
18:37 Recap
---
RISC-V Simulator:
simulator.ascslab-tools.org/s...
---
laurieWIRED Twitter:
/ lauriewired
laurieWIRED Website:
lauriewired.com
laurieWIRED Github:
github.com/LaurieWired
laurieWIRED HN:
news.ycombinator.com/user?id=...
laurieWIRED Reddit:
/ lauriewired
Пікірлер: 47
Only this video preview is the best pointers explanations I have seen before 😂
Your production is incredible, these are so many lain references
Lol i love the thumbnail
@flopasen
8 ай бұрын
same it's funny as
@trichomaxxx
2 ай бұрын
lmao came here just to say that
THANK YOU SO MUCH FOR THE VIDEOOOO, i'm so obsessed with risc-v atm 😭😭😭😭😭
@naelpontes8444
4 ай бұрын
Same! I wanna learn how to make game emulators using it.
You have such a great channel.
Amazing content like always!
Excellent as always👏👏
Thank you, great video !
Great explanation!
Interesting the convention for RISC-V.
love your videos
ok so my stumbling upon this content is really fortuitous because I know very little about programming, but have decided to learn C and MIPS asm for the R3000 the PS1 used so I can learn to decompile Megaman Legends and Serial Experiments Lain for PS1. I don't know if you have any playstation reverse engineering stuff in the pipeline but I would absolutely LOVE that, as this is a bit overwhelming at first!
@anon_y_mousse
4 ай бұрын
Are you writing a PS1 emulator to aid with disassembly? If not, I'd advise you to start there, because you could step through the code as it's running. If you don't want to write one yourself, then consider using one of the numerous open source PS1 emulators as a starting point. I would recommend PCSX-ReARMed, as I found its source code rather easy to navigate when I used it on my Raspberry Pi and had to modify it to work with my controller.
clicked on the video and insta-liked because of the preview alone. thanks for the great content as always, though.
@johnose9326
9 ай бұрын
It remind me of the Anya picture and she did it spot on
@mahussain1
8 ай бұрын
@@johnose9326 you mean Anya from IGI's mission director, right!? :D
i like ur channel. ur funny.
Adding '#pragma GCC optimize ("O0")' to the beginning of the c-code of the risc-v simulator seems to convince it to not optimize away your example.
I'm really curious as to why RISC-V Assembly separates the addresses into "upper" high-order bits (most significant part) versus the low-order bits (the least significant part). Is it related to WORD alignment, I wonder? Also, is this unique to RISC-V or other Assembly languages do it too...?
@GoatZilla
3 ай бұрын
Because you can't fit 32 bits of immediate into an instruction that itself is 32 bits long. You'd have no space for the actual instruction encoding. The interesting thing is the split at 20 bits, which means if your data section is 4k aligned/sized then really you only need to load the upper bits once and then only need to load the lower whenever you change locations.
Beginning of video is horror but inside lot of knowledge we get
@1fareast14
3 ай бұрын
vstspeak my beloved 😂
wow, what version of windows do you use? It looks like super old version?
@aprilzhao5212
Ай бұрын
seems gentoo
actual asmr
good thumbnail
Thumbnail>>
im not 32 years old i'm 20 + 12!!!
This Video is super cool!
@cubernetes
9 ай бұрын
Didn't expect you here! Fellow 42 student
@onaecO
9 ай бұрын
I just followed the pointers, like u fellow haha @@cubernetes
@cubernetes
9 ай бұрын
Badumtssssss
@onaecO
9 ай бұрын
yeah, nerdy sarcasm is the worst@@cubernetes
Interesting they split the load immediate into 20 and 12. Someone was thinking about paging...
Such a cute voice
'int that the way
Normally I can't stand youtubers sticking their dumb faces in dumb expressions on all their dumb thumbnails, but this is accurate
Wtf am i doing here, I'm just a web developer. I guess the thumbnail did the job.
based anya thumbnail
U so cute
no soy face for the thumbnail? it would have been perfect!
So you're an AI?
why do you copy other peoples thumbnails?