ARM Assembly: Lesson 11 (Stack Operations)

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

КОМЕНТАРІ • 35

  • @JohnJolly
    @JohnJolly Рік тому +12

    I'm an old grizzled assembly language programmer. You presentation of stack operations is blissfully pleasant. I will be watching your other videos and very likely recommending your videos to my students.
    Thank you for being awesome.

  • @bensergentanis496
    @bensergentanis496 10 місяців тому +2

    These are awesome! I've gone through the series and learned enough to write a little function that computes factorials for positive and negative numbers! Please make more of these if you can!

  • @evermerino1733
    @evermerino1733 Місяць тому

    I wanna thank God, but more importantly I want to thank you for getting me through the tough times of being in the class that I am, and giving me hope that I can pass. I cannot thank you enough! This tutorial is everything I needed and more. You are best at everything!!! #WOMENINSTEM #COMPSCIMENSMELL #IDidIt

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

    I just found your channel by accident. One of your videos popped up and while it wasn't really relevant to what I needed (trying to figure out why a particular app won't work on any Android emulator I try), I felt the need to stop by and say that the editing and style on your videos is amazing. Your thumbnails, too. As a fellow aspiring UA-camr (with totally different subject matter), I can only hope to be as dedicated. I was legitimately shocked to see that you didn't have a crazy amount of subscribers. Keep up the good work!

  • @johnmckown1267
    @johnmckown1267 4 місяці тому

    Nice beginner's tutorials. Have you considered something similar for RISC-V when it becomes more mainstream for desktop applicationss?

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

    Thank you for all your videos Laurie. There is so much to learn for me. 🙏 You are awesome. 🎉

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

    Thanks for all your effort! Great content!

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

    Probably the best channel to learn asm. Thanks!!

  • @alexweymans
    @alexweymans 8 місяців тому +1

    Thank you for this series! I learned a lot.

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

    you definitely deserve more subscribers, trying to get into Reverse Engineering and this really helps

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

    Great content! Thanks so much for this series on ARM. I have learned so much, I can finally understand a bit of assembly.

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

    This has been a delight to watch, thank you

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

    I've been a hobby amateur coder (from atari basic in 1980 to 6502 assembly on that same system, pascal, turbo pascal, vb, vb .net, some C#) but all in mostly hobby scene.. and I am not very good at it at all lol..
    Your way of explaining modern assembly might actually make me delve into some ASM again!!! Your videos are awesome!!!! you are awesome!!
    You bring everything with such enthusiasm!

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

    awesome series. love the style and editing!

  • @joebrewer1892
    @joebrewer1892 9 місяців тому +1

    Loving this content. What is the benefit of modifying the stack pointer and using str as opposed to using push and pop?

    • @oliverdowning1543
      @oliverdowning1543 7 місяців тому +2

      From what I can tell, after asking copilot. the main concern here might be how it performs at scale. Since 1 register: r4, is being used for each value being passed to the stack, you would need a separate push operator for every value. Since we know how far the stack pointer will have gone, we can just move the stack pointer once at the start then only call a store operator for each value which uses fewer CPU cycles than the push operator since it doesn’t need to change the stack pointer itself. You can imagine that if you’re calling many functions with large numbers of arguments then saving a handful of CPU cycles for every function call might be helpful. Maybe there’s some other, more technical, reason as well, but hopefully that provides a fairly satisfying answer (even if I’m nowhere near qualified to actually answer the question and I just asked CoPilot and I’m secretly hoping that if I’m wrong then someone more experienced will now swoop in to correct me).

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

    tks for all ^^

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

    Pretty lady explains pretty good :) thank you so much for your lessons!

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

    In the new program, it does not appear that you preserve the r0 register. upon return, you move the result to r2, de-allocate the stack space, and then pop the lr. But r0 still holds the accumulated sum of 21 correct? Not sure I understand pushing then popping the LR? At the end of the program, you have just set the lr back to pointing the value it was at the start of the program. I am having trouble seeing the point of that? Why not just let it point the line after the last line of the program where you can branch to _end?

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

      I am having issues understand lr part too. I understood the intention at the beginning of the video of lr just preserving it so the whole program isn't confused and can carry on but isnt str r4, [sp] affecting the stack and when you do pop {lr} it will put #6 into lr so 0x0000(#6 in hex) as address which is wrong. As usually most of the tutorials contain mistakes, wrong examples and little explanation. But as usually just read docs and try to implement the stuff by yourself and we should be fine.

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

      and... here is the answer:
      Here's why saving and restoring LR might be necessary:
      Preservation of the Calling Function's State: When a function makes a call to another function (BL), it's essential to preserve the caller's return address. If you don't preserve LR before making a function call (BL), the callee function may overwrite it with its own return address. Saving LR before the call (PUSH {LR}) ensures that the return address of the calling function is preserved, and it can be restored later.
      Restoring the Return Address: After the callee function completes its execution, it needs to return control to the calling function. To do this correctly, the return address stored in LR before the function call (PUSH {LR}) needs to be restored. This is done by popping the return address off the stack and placing it back into LR before executing the POP {PC} instruction, which effectively returns control to the caller.

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

      And she explained at 2:27 that it is useless but in the future if you are inside the function you might do that because you wanna return to whatever next instruction needs to be executed and also she kept it here for the sake of showing you how "stack is growing downwards" in this case when u do push {lr} it did sub lr, lr, #4 then str lr, [sp] so basically doing: push {lr} is same as 1) sub lr, lr, #4 ; 2) str lr, [sp]. Also you can translate it to: stmdb sp! {lr}. Now that I did write this I understood the thing 100%.

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

    What if I want a function that returns more the just one value in r0? I cpulater does not like if I try to push return values on the stack. Upon returning to the calling routine and trying to pop the values pushed to the stack from the function it crashes complaining I have "clobbered" the sp??? Help please

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

      You need a pointer to return multiple values, just like in C. Higher language just abstract it for u by unpacking the return through pointer arithmetic's. You should not manipulate the SP during function execution, think about it like a link-list if you cut off the head of the list you lost the whole list and also if you cut of the tails you lose the whole list in a double link list and just that data in a single link list

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

    thank you

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

    Thanks for the vid, the content is good, the pacing is appreciated and styling is cool.
    However the styling can be a bit distracting at times especially when it zooms in and out or when text pops in while hiding the code. I say reduce the noise and focus more on the content. Make the text size bigger too.
    Anyways great vid 👍

  • @tamimayan2028
    @tamimayan2028 Місяць тому

    i think that x86 is very old,so it can be replaced by ARM . So should I learn ARM or x86. Recommend me

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

    🙌

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

    NEON when?

  • @DutchNorthAtlanticAlliance
    @DutchNorthAtlanticAlliance 4 місяці тому

    So Laurie, I'm lost at how this helps reverse engineering malware? Because as a mathematician, I only see we switch some numbers around? Forgive me, I'm completely new to reverse engineering 😅

  • @johnmckown1267
    @johnmckown1267 4 місяці тому

    Hum, interesting to manipulate the sp & str rather than push.

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

    shoutout to /g/

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

    slay

  • @mohammedmarhnine8194
    @mohammedmarhnine8194 Місяць тому

    I want to marry you, dream girl for any architect!! are you agree? lol