Using Recursion in ARM Assembly to compute the Fibonacci Sequence

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 69

  • @CJ1337HF
    @CJ1337HF Рік тому +64

    The quality of the video editing just keeps going up! Great stuff

  • @adailtonjn
    @adailtonjn Рік тому +16

    It's really nice to see projects written in assembly. More videos like this, for ARM and RISC-V,, are very welcome

  • @ankk98
    @ankk98 11 місяців тому +6

    I can never put this crazy efforts on aesthetics.
    Pure respect for that!

  • @ntcarver
    @ntcarver Рік тому +5

    The retro aesthetics of your videos are so cool. I look forward to watching more!

  • @platypii2350
    @platypii2350 9 місяців тому +2

    Incredible editing, love the aesthetic.

  • @polaris_babylon
    @polaris_babylon Рік тому +4

    I computed Fibonacci Sequence in MIPS Assembly, pretty cool.
    Btw great channel, the level of production and aesthetic is amazing!

  • @jonathanalonso6492
    @jonathanalonso6492 Рік тому +2

    I have arrived to this video by the power of the algorithm gods, and _my god_ the production value is off the charts!
    Subscribed _immediately._

  • @JTMartineau
    @JTMartineau 11 місяців тому +1

    This was great. Thank you so much. :) I also really appreciate the nice animations you've made. They're veeeery clean and nice looking. I love the clicks.

  • @stefanalecu9532
    @stefanalecu9532 Рік тому +4

    I'm genuinely impressed at the gold mine that is this channel, you should be having at least 10x your current sub count.
    By the way, will you continue your RISC-V assembly series?

  • @MeloettaMarmalade
    @MeloettaMarmalade 10 місяців тому +1

    The SEL intro was an instant subscribe

  • @flymetothemoon5138
    @flymetothemoon5138 11 місяців тому +1

    I'd love to know more about how you create and edit these videos, I love the style and animations. great stuff!

  • @ohaia23
    @ohaia23 Рік тому +1

    This channel is very underrated!

  • @guillermogarciamanjarrez8934
    @guillermogarciamanjarrez8934 7 місяців тому +1

    Damn loved this, got PTSD from when I had to write assembly code for a PIC32 in university, suffered so much to make a program to calculate 2's exponentials and displaying it in 8 segments display, writing the delay function just killed me. Nice remembering those times, now my brain can´t function if I´m not using C# or python XD

  • @JulietteLloyd-r3o
    @JulietteLloyd-r3o Місяць тому

    Thank you SO MUCH for this tutorial. You have SAVED my life!

  • @ah_jay
    @ah_jay Рік тому +3

    Love the Serial Experiments Lain vibes
    😊

  • @mfreeman451
    @mfreeman451 Рік тому +3

    your videos are the best.. even if i don't understand shit

  • @chitlitlah
    @chitlitlah 6 місяців тому

    Correct me if I'm wrong, but when you call fib(16), it has to call fib(15) and fib(14) to return the result, and calling fib(15) means calling fib(14) and fib(13), and both times you call fib(14), it calls fib(13) and fib(12), etc. So to do fib(n), it has to call that routine 1 + 2 + 3 + ... + n times in total. It works, but that's going to get pretty intense for big numbers, which is probably why even just fib(16) took a while to calculate. It's just for teaching purposes so I'm not criticizing, but it's definitely not the most efficient way to do it. It kind of makes me want to convert it to x86 assembly to see how quickly it gets out of control on my computer.

  • @CandyHam
    @CandyHam 11 місяців тому +1

    How do you only have 17,000 subscribers.... That'll probably change quickly

  • @TheCorruptedHuman
    @TheCorruptedHuman 7 місяців тому +1

    Couldn't huge gains be made if you store the value in a 32 bit register then use UXTH and LSR instead of pushing and popping stuff? (Just learning arm, sorry if this is a dumb question. I was just thinking you could store two values in a single register and then keep shifting everything right)

  • @notpersuingrelaxation8835
    @notpersuingrelaxation8835 9 місяців тому

    What's your windows theme? Looks cool

  • @somedude5414
    @somedude5414 8 місяців тому

    Cute as a kitten, sharp as a tack.

  • @francosepulveda6320
    @francosepulveda6320 6 місяців тому

    good job bro! nice work amigou

  • @alessandrobelottidev
    @alessandrobelottidev Рік тому +1

    fantastic video, thanks

  • @Moxie-g3t
    @Moxie-g3t Рік тому

    Everything you do is so cool 😎

  • @AdventuresOfPepero
    @AdventuresOfPepero 7 місяців тому

    coquetry + low level programming passion!
    I never saw this combination

  • @xorlop
    @xorlop Рік тому +5

    where did this awesome person come from

  • @paulhewitt7664
    @paulhewitt7664 11 місяців тому

    Very nice! Spiral out!!!!

  • @rpeckhoff
    @rpeckhoff 10 місяців тому

    Is recursive or iterative more performant on Armv7 processors? It would be interesting to see the performance difference with some pre-processor unrolling of both a recursive and iterative case.

  • @DavidConnerCodeaholic
    @DavidConnerCodeaholic 11 місяців тому

    my first instinct was to use a cycle of subroutines each using 2 registers to retrieve and a third to store. The setup writes to A & B, then calls the first sub, which reads A & B, writes to C, then calls the second sub. That reads B & C, writes to A. Each subroutine needs to check N, and either return or decrement, calculate and call next sub. This is more efficient.

  • @arnabiitr
    @arnabiitr 6 місяців тому

    can this code be compiled on x86_64 arch or it needs to be modified

  • @neko-sauerbraten7774
    @neko-sauerbraten7774 Рік тому +3

    very underrated

  • @p2k7777
    @p2k7777 11 місяців тому +4

    The production quality is so high, it seems like a plant

  • @davidplanet3919
    @davidplanet3919 10 місяців тому

    Memoization is your friend with this algorithm 😊

  • @randommoosebrains
    @randommoosebrains Рік тому +1

    Burnout 3….good times!

  • @kayakMike1000
    @kayakMike1000 11 місяців тому +1

    Recursion is somewhat frowned on in embbedded programing.

  • @epiclivestreams6733
    @epiclivestreams6733 5 місяців тому

    Why did you not cache the Fibonacci(n-2) number when you were computing Fibonacci(n-1)?

  • @ザウアークラウトマン
    @ザウアークラウトマン 11 місяців тому

    For anyone trying this: you also need to check if r0 is equal to 2 in the beginning of the function and return 1 if that's the case.

    • @fmaximus
      @fmaximus 6 місяців тому +1

      The program Laurie wrote calculates fib(2), instead of checking and returning 1. fib(2) = fib(1) + fib(0) = 1 + 0 = 1

  • @jaredg.1609
    @jaredg.1609 11 місяців тому

    If you want to lower the time complexity of this to ~O(n), I always like the dynamic programming approach

  • @abrahamwang4021
    @abrahamwang4021 11 місяців тому

    👋Thanks

  • @Giurigi123
    @Giurigi123 9 місяців тому +2

    didnt understand shit but damn u look fine

  • @robertlean4563
    @robertlean4563 Рік тому

    Could you do a video on the fairly recent OAuth2 session hijacking malware that allows for continuous access to google services even if they reset the password

  • @aydashm
    @aydashm Рік тому

    I saw your video and it was so helpful. I should make a project in assembly language in vga pixel buffer in cpulator that I should make a thing in this vga and it should move right/down. I dont know how can I do this.Can you help me?

  • @xobk
    @xobk 10 місяців тому

    We need a third angle next, a corner-mounted fuzzy security camera feed.

  • @aydashm
    @aydashm Рік тому

    Hi,I`m from iran. I saw your video and it was really helpful. I want to know how can I make a thing in vga pixel buffer in cpulator that this picture can move right/down. I have this problem.can you help me??

  • @francosepulveda6320
    @francosepulveda6320 6 місяців тому

    can you help us to make a arm assembly code of the house robber problem? i will be wait your response, xoxo

  • @lterego
    @lterego 11 місяців тому +4

    Using a bad algorithm in assembly kind of defies the purpose of using assembly. Recursive fibonacci both recomputes the same value multiple times and takes up unnecessary stack space. I hope you have the iterative algorithm lined up as well.

  • @PraveenSingh-js6qq
    @PraveenSingh-js6qq 10 місяців тому

    Would you be interested in taking up game engine programming?

  • @SIGSEGV1337
    @SIGSEGV1337 Рік тому

    songname?

  • @tadasturonis
    @tadasturonis Рік тому +1

    based laurie

  • @RedHair651
    @RedHair651 6 місяців тому

    I didn't really understand what was going on with r0 and r1. Are they variables? Addresses? Stack indices? Separate stacks?
    I thought they were variables and you were popping and pushing to and from the stack, and putting popped values into r1 and r0 variables, but even that didn't seem to make sense.

    • @fmaximus
      @fmaximus 6 місяців тому

      They are registers in the CPU. Assembly is really low level, telling the processor what to do.

  • @ewasteredux
    @ewasteredux 10 місяців тому

    #respect

  • @sufalt123
    @sufalt123 3 місяці тому

    Coool

  • @sekaibelle
    @sekaibelle Рік тому +51

    are you a fbi agent?

    • @williamoneal1811
      @williamoneal1811 7 місяців тому

      As time goes on, I only become more questioning

  • @shriokei
    @shriokei Рік тому +2

    blessed upload

  • @mspeir
    @mspeir 8 місяців тому

    I'm not familiar with ARM assembly, but this doesn't look like it should work. You compute r0 - 1 and then branch back to the start of the fibonacci function. How does the code ever get to the r0 - 2 or the add part of the code? My best guess is that "bl" isn't "branch and link" (honestly doesn't make sense anyway), but "branch if less than". Is that correct? But even that wouldn't work. "Branch if less than" what, exactly? Zero? Something doesn't add up here...

  • @aydashm
    @aydashm Рік тому

    Hi I am from iran

  • @mikidep_old
    @mikidep_old Рік тому

    Just sitting here waiting for her to go Nix

  • @ebtihajabdullah800
    @ebtihajabdullah800 10 місяців тому

    Bruh top tier shit

  • @aalvarez711
    @aalvarez711 Рік тому

    Zero Index!

  • @chuckmacdonald1151
    @chuckmacdonald1151 10 місяців тому

    throw both them backs back!

  • @desertfish74
    @desertfish74 Рік тому

    neko

  • @ottoseer
    @ottoseer 10 місяців тому

    Forty two!? RUBBISH!

  • @BanAaron
    @BanAaron Рік тому

    Is it just me, or does she have the same voice as Poppy?