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

  • @Nick-xp8xd
    @Nick-xp8xd3 ай бұрын

    Only this video preview is the best pointers explanations I have seen before 😂

  • @AlexanderPrussak
    @AlexanderPrussak4 ай бұрын

    Your production is incredible, these are so many lain references

  • @ThiagoSTeixeir4
    @ThiagoSTeixeir49 ай бұрын

    Lol i love the thumbnail

  • @flopasen

    @flopasen

    8 ай бұрын

    same it's funny as

  • @trichomaxxx

    @trichomaxxx

    2 ай бұрын

    lmao came here just to say that

  • @bass9112
    @bass91127 ай бұрын

    THANK YOU SO MUCH FOR THE VIDEOOOO, i'm so obsessed with risc-v atm 😭😭😭😭😭

  • @naelpontes8444

    @naelpontes8444

    4 ай бұрын

    Same! I wanna learn how to make game emulators using it.

  • @lupusthelupus
    @lupusthelupus8 ай бұрын

    You have such a great channel.

  • @spellboundfeline
    @spellboundfeline9 ай бұрын

    Amazing content like always!

  • @danielrunescape410
    @danielrunescape4109 ай бұрын

    Excellent as always👏👏

  • @RadovanWagner
    @RadovanWagner26 күн бұрын

    Thank you, great video !

  • @sigfyg8384
    @sigfyg83844 ай бұрын

    Great explanation!

  • @mytechnotalent
    @mytechnotalent9 ай бұрын

    Interesting the convention for RISC-V.

  • @yada9231
    @yada92319 ай бұрын

    love your videos

  • @MistereXMachina
    @MistereXMachina8 ай бұрын

    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

    @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.

  • @noctiflorous1337
    @noctiflorous13379 ай бұрын

    clicked on the video and insta-liked because of the preview alone. thanks for the great content as always, though.

  • @johnose9326

    @johnose9326

    9 ай бұрын

    It remind me of the Anya picture and she did it spot on

  • @mahussain1

    @mahussain1

    8 ай бұрын

    @@johnose9326 you mean Anya from IGI's mission director, right!? :D

  • @ma2perdue
    @ma2perdue9 ай бұрын

    i like ur channel. ur funny.

  • @atoomnet
    @atoomnet2 ай бұрын

    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.

  • @naelpontes8444
    @naelpontes84444 ай бұрын

    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

    @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.

  • @67abhijeetbhor4
    @67abhijeetbhor48 ай бұрын

    Beginning of video is horror but inside lot of knowledge we get

  • @1fareast14

    @1fareast14

    3 ай бұрын

    vstspeak my beloved 😂

  • @guigomez3441
    @guigomez34413 ай бұрын

    wow, what version of windows do you use? It looks like super old version?

  • @aprilzhao5212

    @aprilzhao5212

    Ай бұрын

    seems gentoo

  • @trejohnson7677
    @trejohnson76778 ай бұрын

    actual asmr

  • @yawa-ayura
    @yawa-ayura9 ай бұрын

    good thumbnail

  • @daljeetbhati8353
    @daljeetbhati83539 ай бұрын

    Thumbnail>>

  • @flopasen
    @flopasen8 ай бұрын

    im not 32 years old i'm 20 + 12!!!

  • @onaecO
    @onaecO9 ай бұрын

    This Video is super cool!

  • @cubernetes

    @cubernetes

    9 ай бұрын

    Didn't expect you here! Fellow 42 student

  • @onaecO

    @onaecO

    9 ай бұрын

    I just followed the pointers, like u fellow haha @@cubernetes

  • @cubernetes

    @cubernetes

    9 ай бұрын

    Badumtssssss

  • @onaecO

    @onaecO

    9 ай бұрын

    yeah, nerdy sarcasm is the worst@@cubernetes

  • @GoatZilla
    @GoatZilla3 ай бұрын

    Interesting they split the load immediate into 20 and 12. Someone was thinking about paging...

  • @nonamedelete9132
    @nonamedelete91328 ай бұрын

    Such a cute voice

  • @BrianHenryIE
    @BrianHenryIE8 ай бұрын

    'int that the way

  • @beecee793
    @beecee7939 ай бұрын

    Normally I can't stand youtubers sticking their dumb faces in dumb expressions on all their dumb thumbnails, but this is accurate

  • @alphacentauri8035
    @alphacentauri80359 ай бұрын

    Wtf am i doing here, I'm just a web developer. I guess the thumbnail did the job.

  • @Firebrand1100
    @Firebrand11009 ай бұрын

    based anya thumbnail

  • @VivaLyaLibertyBibaLyaLiberty
    @VivaLyaLibertyBibaLyaLiberty9 ай бұрын

    U so cute

  • @mr.sunshine1444
    @mr.sunshine14449 ай бұрын

    no soy face for the thumbnail? it would have been perfect!

  • @iro4201
    @iro420118 күн бұрын

    So you're an AI?

  • @sulfasolate
    @sulfasolate9 ай бұрын

    why do you copy other peoples thumbnails?

Келесі