Computing the Euclidean Algorithm in raw ARM Assembly

  Рет қаралды 237,169

LaurieWired

LaurieWired

Күн бұрын

In this video, we translate C++ into equivalent ARM assembly code to compute the GCD of two numbers (also known as the Euclidean Algorithm). We visualize our completed GCD calculator on a raspberry pi.
---
Timestamp:
00:00 Intro
00:44 C++ Equivalent
02:26 Base Case in ASM
04:36 Writing Comparison
05:26 Recursive Case
07:29 Manual Creation of a Modulus
09:10 Calling the function
10:11 Compiling and Running Code
---
Links Mentioned in Video:
github.com/LaurieWired/Assemb...
---
laurieWIRED Twitter:
/ lauriewired
laurieWIRED Website:
lauriewired.com
laurieWIRED Github:
github.com/LaurieWired
laurieWIRED HN:
news.ycombinator.com/user?id=...
laurieWIRED Reddit:
/ lauriewired

Пікірлер: 479
@chyldstudios
@chyldstudios 3 ай бұрын
As someone who subscribes to a ton of tech-related channels, this is the first time KZbin recommended me to this channel.
@HadesTimer
@HadesTimer 3 ай бұрын
Same
@Alberto_Cavalcante
@Alberto_Cavalcante 3 ай бұрын
Same
@steadystreamofserotonin5500
@steadystreamofserotonin5500 3 ай бұрын
Came for the thumbnail, left for the content
@luisdanielmesa
@luisdanielmesa 3 ай бұрын
Yeah, me too... The algorithm is getting worse and worse.
@pluto9000
@pluto9000 3 ай бұрын
Same
@OneAndOnlyMe
@OneAndOnlyMe 4 ай бұрын
How has Google not recommended this channel to me before! 6502 machine coder here, loving this.
@sno_crash
@sno_crash 2 ай бұрын
Because you'd probably get a stack overflow if you tried using this approach 🙂
@OneAndOnlyMe
@OneAndOnlyMe 2 ай бұрын
@@sno_crashWhy would a recommendation algorithm cause an overflow?
@sno_crash
@sno_crash 2 ай бұрын
@@OneAndOnlyMe The algorithm wont, but the use of this Euclidian function on a 6502 might. It was a joke; that the Google Algorithm was protecting you from such a demise, by not recommending it to you previously (as you had rightfully asked).
@OneAndOnlyMe
@OneAndOnlyMe 2 ай бұрын
@@sno_crash LOL - I meant more that I the KZbin algorithm hadn't recommended Laurie's channel.
@speed999-uj5kr
@speed999-uj5kr 2 ай бұрын
Liar
@ThomasThorsen
@ThomasThorsen 3 ай бұрын
This is a great introduction and walk through for newcomers to assembly, but beware that the implementation has a quite significant flaw that will only reveal itself when called from other functions that have several live registers and happen to use r4 and store a value in it when it makes the call to this gcd function. The calling function will expect that the gcd function preserves the r4 register, as it is not a scratch register like r0-r3 are. This will manifest in miscalculations, unpredictable behavior and likely instability/crashes in the application using this function. An easy fix would be to push the r4 register along with lr to the stack, and pop it again (i.e. push {r4, lr} - pop {r4, pc}), but this of course increases the stack usage even more. Another approach would be to use r12 which is also a scratch register. It would also be a good idea to make the implementation non-recursive as it can overflow the stack if it recurses too many times. For this algorithm this is quite easy as you can do tail call optimization by simply removing the push, replacing the pop by "bx lr" and doing a "b gcd" instead of "bl gcd" (which means the lr does not get overwritten for each iteration and retains the original return address that was written when the function was called the first time). This means the stack won't grow for each iteration.
@The-KP
@The-KP 2 күн бұрын
Blah blah blah.
@BenjaminWheeler0510
@BenjaminWheeler0510 4 ай бұрын
Easily the greatest common divisor in the history of all common divisors
@alicewyan
@alicewyan 4 ай бұрын
Who knew it'd be seven?
@mebibyte9347
@mebibyte9347 4 ай бұрын
Underrated channel. I cannot wait to get fat enough in my CS courses to understand this
@TheBrainn
@TheBrainn 4 ай бұрын
I cant wait to get fat enough either
@turkviktor
@turkviktor 4 ай бұрын
You will probably learn nothing meaningful from the CS courses.
@paulhbartley8030
@paulhbartley8030 4 ай бұрын
@@turkviktor really?
@poopsmith890
@poopsmith890 4 ай бұрын
@@paulhbartley8030 No not really, CS courses can teach you plenty of useful things and expose you to very passionate people. That doesn't mean they're absolutely necessary, but that guy isn't giving anything beyond an insipid sensationalist analysis
@yogxoth1959
@yogxoth1959 4 ай бұрын
@@turkviktor Bullshit. It's obvious you haven't been to university.
@maelstrom57
@maelstrom57 4 ай бұрын
I was looking for something to snooze to and thought this was ASMR Assembly.
@esra_erimez
@esra_erimez 4 ай бұрын
🤣
@jack_2612
@jack_2612 4 ай бұрын
I was just checking the comments half way into the video and you, sir, just made me notice that it's not ASMR Assembly indeed lol
@jack_2612
@jack_2612 4 ай бұрын
also, don't know anything about coding, but YT is doing YT things with its algorithm
@rogerwinright2290
@rogerwinright2290 4 ай бұрын
I'm instantly a fan! Notepad++, Windows XP, talking about assembly language, and why it's great to scaffold in higher-level languages is awesome. I'm looking forward to exploring more of your channel in the future! Thank you for this
@SteveWaltersY
@SteveWaltersY 4 ай бұрын
And the Solaris? border around her facing camera. Nice touch.
@lordlyamiga
@lordlyamiga 4 ай бұрын
it's a XP theme no actual Xp cuz they are using modern CMD and also edge and explorer logo are from win 10
@rogerwinright2290
@rogerwinright2290 4 ай бұрын
@@lordlyamiga I had figured as much! I saw another cool game developer on here using Linux Mint with an XP theme too. Super cool!
@TheFern2
@TheFern2 4 ай бұрын
the XP theme is a nice touch my favorite windows of all time, my first laptop was on XP much simpler times before metro ui
@deanwilliams433
@deanwilliams433 4 ай бұрын
@@TheFern2don't get the nostalgia for XP, it was a security nightmare. Windows 7 was leaps and bounds better.
@Summanis
@Summanis 4 ай бұрын
I finally watch Lain and now the KZbin algorithm is rewarding me
@ferocious_r
@ferocious_r 3 ай бұрын
With what?
@Summanis
@Summanis 3 ай бұрын
@@ferocious_r more Lain
@horvathpeter8130
@horvathpeter8130 3 ай бұрын
Should it run too in assembly!
@PaulEmsley
@PaulEmsley 3 ай бұрын
I have been watching tech and programming channels for many years. This is the first time KZbin has recommended you. Glad to see it!
@treelibrarian7618
@treelibrarian7618 4 ай бұрын
So it's been a few years since I was last writing in ARM asm (32-bit MCUs), so I might be a bit rusty... but I thought I saw a few tricks you'd missed, opened a notepad and downloaded an arm instruction-set reference and had a go myself. What I noticed: 1: this is an ideal opportunity for tail recursion, simplifying the recursion to effectively a loop and removing the need to unwind the calls from the stack at the end 2: move can set flags, removing the need to compare to determine zero both on entry and within the loop 3: once you don't need to push/pop, bx lr can be used to return and can even be used with condition codes ;; arm version gcd: movs r1, r1 ;; mov can set flags? easiest way to get the z flag set for a zero input? bxeq lr ;; conditional return. nice. assumes A32 instruction set tho... .loop: sdiv r2, r0, r1 ;; I find it surprising that ARM doesn't have some way to return mul r2, r2, r1 ;; the remainder from a division... the bits are right there at the sub r2, r0, r2 ;; end of the process, but then they get lost? and I have to recompute them? smh. mov r0, r1 ;; but even so, the ARM version is still smaller and neater than the x86, movs r1, r2 ;; which has to dance around the fixed register usage of its DIV instruction bne loop ;; mov setting flags means that we can conditionally loop - also could set flags on the sub bx lr ;; tail recursion means no push lr/pop pc, and we can use the direct return 4: all this is very academic since most of the time will be in the div operation anyway... ;; x86 version for comparison gcd: ; expects a in edi, b in esi mov eax, edi test esi, esi jz .out ;; no conditional return .loop: xor edx, edx ;; top half of dividand must be zeroed div esi ;; div takes edx:eax as dividand, returns quotient in eax and remainder in edx mov eax, esi mov esi, edx test edx, edx ;; have to use dedicated instruction for setting flags jnz .loop ;; but at least these test/branch combo's get turned into a single µop when executed .out: ret ; return is in eax ;;; the iterative logic as C int gcd(int a, int b) { if(!b) return a; int c; while(c = a % b) { a = b; b = c; } return b; }
@steffen5121
@steffen5121 4 ай бұрын
When ARM asm ASMR?
@xydez
@xydez 4 ай бұрын
Yeah thats what i thought aswell, i gulped when she said recursive function.
@michaelbauers8800
@michaelbauers8800 3 ай бұрын
@@xydez I wonder what the default stack size on the PI is?
@traal
@traal 4 ай бұрын
Serial Experiments Lain! And the Wired. Wow!!! 😳 Awesome references. Just stumbled on this channel, so I wanted to acknowledge that. 😊
@Johno3998
@Johno3998 4 ай бұрын
same, what good editing/references
@GrahamCrannell
@GrahamCrannell 3 ай бұрын
praise the algorithm gods... how am i only *just* learning about this channel?
@Karuda_
@Karuda_ 3 ай бұрын
Getting the same exact feeling right now
@ogphoenix8965
@ogphoenix8965 4 ай бұрын
The quality of the video and the content is top notch. Here before 1 M subscribers
@808v1
@808v1 3 ай бұрын
great video - also your comfortable commentary as you do the typing/transposing etc. was liquid smooth and really makes this video of a higher quality.
@808v1
@808v1 3 ай бұрын
oh, sub'd.
@sharkonet3636
@sharkonet3636 4 ай бұрын
I don't know why I found this channel only now ??!! This looks like to be an amazing channel, will go and watch other videos 😍😍 I really enjoy it :)
@pertsevds
@pertsevds 3 ай бұрын
KZbin algorithm brought me here. This channel is pure gold. Subscribed.
@Scriabinfan593
@Scriabinfan593 4 ай бұрын
New subscriber here, and just noticed that you have a playlist of ARM Assembly tutorial. I'll definitely be binge watching that.
@clarkgriswold-zr5sb
@clarkgriswold-zr5sb 3 ай бұрын
Haven't done any coding since 1985-86. But somehow your video popped up in my feed... I did enjoy the video!
@sushiConPorotos
@sushiConPorotos 4 ай бұрын
OMG. Last time I wrote assembly was like 20 years ago! I love this woman!
@tom_verlaine_again
@tom_verlaine_again 3 ай бұрын
This is so good! Your attention to detail is insane! Congrats
@maydude2
@maydude2 4 ай бұрын
just in case, the modulo implementation works out if you use integer division not "normal" division (2//5)*5=0, but (2/5)*5=2
@gabo3k3k
@gabo3k3k 4 ай бұрын
I haven’t touched assembly since my C64 days, this channel is a great motivation to play with the rpi. And since I am from the 80s I love the vibes of this channel, it has some Max Headroom/beakman’s/matrix vibes, really well produced!
@ProBloggerWorld
@ProBloggerWorld 4 ай бұрын
For me it is the opposite: I haven’t stopped touching C64 assembly, still active in the demo scene. 😅
@Hiro6543
@Hiro6543 3 ай бұрын
Thanks for teaching me that roundabout way to calculate a % b. It's simple and clear, but I never would have thought about it.
@fabiano9277
@fabiano9277 4 ай бұрын
Thanks for your amazing content dear Laurie. 🎉
@hlodvic6678
@hlodvic6678 2 ай бұрын
looking for KZbinr making tutorial about arm assembly, never found, and tonight KZbin recommended this channel, okay KZbin, okay
@swankidelic
@swankidelic 4 ай бұрын
I'm so used to using Java/Kotlin and having a hard time translating that experience to assembly. I finally get how function signatures map to registers. Really eager to dig into the back catalog now!
@SyncMain
@SyncMain 3 ай бұрын
Loved this! Really great quality all around.
@CrestRising
@CrestRising 3 ай бұрын
I last coded in Arm for an Acorn Archimedes about 35 years ago. Thanks for the memory jolt.
@ram_gog
@ram_gog 4 ай бұрын
Thanks for this Laurie. Already waiting for the next one.
@jaralara6429
@jaralara6429 3 ай бұрын
Blessed by the algorithm today. I never thought about how recursive functions are implemented in assembly
@detocquevi11e
@detocquevi11e 3 ай бұрын
I haven't done assembly language coding since the 80's in my Microprocessor Design (6800, along with some machine coding) and Assembly Programming (8086) classes in college. I thoroughly enjoyed this video.
@shadowlink96
@shadowlink96 3 ай бұрын
Glad you finally had a video blow up so much. Great channel
@GrahamCrannell
@GrahamCrannell 3 ай бұрын
Everybody who comments "the algorithm brought me here" needs to immediately like and subscribe. *Thats* how we can boost channels like this
@Veynney
@Veynney 3 ай бұрын
Incredible production quality!
@totally_not_a_robot1342
@totally_not_a_robot1342 4 ай бұрын
This so cool! I just had to implement the euclidian algorithm as part of a compilers course assignment!!
@streetchronicles9025
@streetchronicles9025 4 ай бұрын
Hi Laurie, you’re amazing and unique, please don’t give up
@iro4201
@iro4201 4 ай бұрын
Don't give up is the worst kind of encouragement as well as my comment advice.
@so7am96
@so7am96 3 ай бұрын
love ur XP theme :D brings back memories
@lashlarue59
@lashlarue59 3 ай бұрын
Thank you! I was going to ask is she doing all of this under Windows XP!
@netx421
@netx421 3 ай бұрын
Very informative glad I found this channel
@jonasc1221
@jonasc1221 2 ай бұрын
I don't know what the heckin flip I'm watching but I freakin know it's epic dude.
@MrDgf97
@MrDgf97 Ай бұрын
Why did KZbin take this long to recommend me this channel. Instantly subscribed
@Saw-qv3bl
@Saw-qv3bl 4 ай бұрын
My professor has actually given us as homework to compute the Euclidean Algorithm however, he told us we had to do it in x86. Still helped me out understanding how to do it tho!
@laurenlewis4189
@laurenlewis4189 4 ай бұрын
Thanks for this! Love your videos' aesthetic, but even moreso I appreciate an expert breaking programming tutorials into individual functions and algorithms instead of programming complex apps to teach many ideas all at once.
@xydez
@xydez 4 ай бұрын
Not to break your bubble but I would hardly call this expertise as that would be insulting to actual experts. Still, it was definitely a good produced video, I like the aesthetic.
@dr.strangelove5622
@dr.strangelove5622 3 ай бұрын
ARM ASM, Windows XP theme!! This channel just got recommended to me! Nice video!! Subscribed!!
@IsmaelLa
@IsmaelLa 4 ай бұрын
What was this! Great tutorial and also Burnout in the end? Amazing.
@cheleon94
@cheleon94 2 ай бұрын
I don't know, this just clicks every key, this atmosphere is perfect
@tolkienfan1972
@tolkienfan1972 4 ай бұрын
I like the recursive version for its readability, but it's worth noting that optimizing compilers will (typically) use a tail recursion optimization to convert the generated assembly into a loop. This is faster and can't blow the stack. I understand this is a (cool) exercise. Just thought someone might be interested.
@hemmper
@hemmper 3 ай бұрын
yup, but her example didn't use stack for recursion
@tolkienfan1972
@tolkienfan1972 3 ай бұрын
​@@hemmperincorrect. It in fact uses "branch with link" along with "push lr" and "pop pc" to implement the recursion. The arguments are not on the stack, which saves some stack space, but each recursion level is indeed storing the link register on the stack.
@guardian-X
@guardian-X 4 ай бұрын
This video style gives me a lot of nostalgia
@ZergD
@ZergD 3 ай бұрын
Thank you dear YT overmind part of the YT algorithm for bringing us all together here! Amazing channel !
@SystemfehlerK
@SystemfehlerK 4 ай бұрын
This has been a very interesting look into modern-day assembly, thanks! But I enjoyed the aesthetics of the video production almost as much! The hacker cave, coding in "new x" files in Notepad++, and on Windows XP? Nevermind the full-screen capture with the camera feed in a separate window. Feels right like the late 2000s.
@actualBIAS
@actualBIAS 4 ай бұрын
wtf, awesome! why haven't I discovered your channel sooner?
@moose43h
@moose43h 4 ай бұрын
Ther quality is this channels is so good it’s suspicious. Also +1 for lain
@OfficialiGamer
@OfficialiGamer 2 ай бұрын
I don't have the patience for coding but I geniunely enjoyed this
@nro337
@nro337 4 ай бұрын
Amazing instruction, so fun to learn!
@OliverObz
@OliverObz 4 ай бұрын
This is such a fun setup!
@VidKa0S
@VidKa0S 4 ай бұрын
Really unique content, informative and enagaging
@ash6202
@ash6202 4 ай бұрын
I like your expression and head movements.👍
@bholmesdev
@bholmesdev 4 ай бұрын
This is a really unique format! Well explained too. Just curious, is that Windows XP ribbon an overlay or is everything *really* being emulated?
@gplastic
@gplastic 4 ай бұрын
it looks like it's running overtop windows 11
@iwasnothere2
@iwasnothere2 3 ай бұрын
ah. you've unlocked good memories. gracias.
@michaelherzig8002
@michaelherzig8002 3 ай бұрын
Before I phrase my note: I stumbled over your video by chance - as often on KZbin - and immediately wanted to know about how (simple or complex?) this algorithm looks in assembly language. I highly appreciate what you do and I understood everything you explained. When I reached around 8:00 in the video I thought - am I incorrect about what parameter sits in what register? Until that position I assumed "a" to be in r0 and "b" in r1. And meanwhile I am absolutely certain about it. Then you said: 1. 7:47 the "sdiv" command: all good 2. 7:54 "remember b is in our r0 register" - eh, no?!? 3. 8:15 the "mul" command: b is in r1: correct 4. 8:34 the "sub" command: you say "a is in r1", what is not correct, but you correctly wrote "r0" I confess: if I would not have had a question mark in my face two times during that passage, I would not have repeated it several times. And now with the repetition I will sure remember it forever and I am also certain about having fully understood your implementation. Possibly you can add some textual remarks into the video at the two mentioned positions. Thank you for your video!
@ramit7
@ramit7 3 ай бұрын
I really love the Lain dp! and of course the content!
@amurrux
@amurrux 3 ай бұрын
I like the channel theme and content 👏
@dfgdfg_
@dfgdfg_ 4 ай бұрын
The comments are 90% simp 😂
@FetchTheCow
@FetchTheCow 3 ай бұрын
How I miss 6502... This is a welcome bit of nostalgia!
@mblaughlin
@mblaughlin 3 ай бұрын
I'm not even a coding person but you do make it interesting
@mrdudolf
@mrdudolf 4 ай бұрын
such a fun format
@tengamangapiu
@tengamangapiu Ай бұрын
This would be super helpful for Javascript programmers looking to learn to program.
@karlkarlsson9699
@karlkarlsson9699 4 ай бұрын
I love videos like this!!!
@improvisedchaos8904
@improvisedchaos8904 7 күн бұрын
why did i never find this channel sooner
@TapeGoatArchives
@TapeGoatArchives 3 ай бұрын
The style of this video is fucking great. Love the way this is presented, I have zero interest in this topic but I'm fascinated by the vintage computer graphics.
@kdog3908
@kdog3908 2 ай бұрын
Assembly has changed a helluva lot since I last wrestled with it. Showing my age but I last wrote assembly code for 16bit 68000 series processors as an engineering student!
@heinrichpreussen
@heinrichpreussen 3 ай бұрын
Only 27k subscribers? Deserves way more
@codewithantonio
@codewithantonio 4 ай бұрын
Oh my god this is the most unique coding tutorial ever!
@publicalias8172
@publicalias8172 4 ай бұрын
The Angel of Arm returns 🙏💘📿
@eliodecolli
@eliodecolli 3 ай бұрын
this is where it's at. you got a new sub
@TheGiuse45
@TheGiuse45 Ай бұрын
Just as a clarification: argument passing in asm is standardized. The requirements for the caller and callee are defined by the "arm thumb procedure call standard" (ATPCS). If you follow this standard you can also call c functions from asm code
@hstrinzel
@hstrinzel 7 күн бұрын
Are you sure that in ARM the division remainder does not also get stored in a register? In X86 Unsigned divide EDX:EAX by r/m32, with result stored in EAX = Quotient, EDX = Remainder. But the funny thing is that YOUR videos are so good that I really study with interest and understand Assembly here for the first time. THANK YOU!
@guillermomontoya3382
@guillermomontoya3382 3 ай бұрын
The Burnout 3 part at the end was the cherry on top for me
@catafest
@catafest 4 ай бұрын
a woman with assembly language this can be dangerous! I'm glad to see that!
@xydez
@xydez 4 ай бұрын
Who would care whether it's woman? To quote linus, i don't care what plumbing you're born with.
@Marcos-tp4lm
@Marcos-tp4lm 3 ай бұрын
your content is amazing!
@Chad48309
@Chad48309 4 ай бұрын
Great channel.
@JiffyJames85
@JiffyJames85 4 ай бұрын
So, newish to assembly (at least haven't written any in two decades), but as the gcd function is a tail call recursion algorithm, this could, in theory, be done without the regular adds to the stack (avoid stack overflows if GCD is called from an already deep stack). Would this be easy to implement?
@JiffyJames85
@JiffyJames85 4 ай бұрын
Would it end up being something like: ``` gcd: push {lr} gcd_sub: // Base case ... mov r1, r4 bl gcd_sub ``` and that way only the initial call to the routine saves the return address.
@sagemitchell8646
@sagemitchell8646 4 ай бұрын
I was thinking about the tail call elimination opportunity too. Wouldn't we want that last line to be `b gcd_sub`(notice `b` instead of `bl`)? My understanding is `bl` would change the link register before jumping to `gcd_sub` whereas `b` would just jump. Maybe it wouldn't matter, though. The address from which `gcd` is called is already on the stack and we pop that value back into the `pc`register to return there. I suppose it may not hurt to write to the link register between those steps.
@JiffyJames85
@JiffyJames85 4 ай бұрын
@@sagemitchell8646 that sounds right. Most of the stuff I did was with the 6502, and I wasn't sure if an arm has extra side effects. So, I made the same assumption as you and left the bl.
@robiniddon7582
@robiniddon7582 4 ай бұрын
A plain b for branch would work. The link register is used to provide the subroutine return address which hasn't changed in your hypothetical iterative implementation. Also the iterative function doesn't need to push the LR cos it never calls anyone else and can return with mov PC,LR or whatever the mnemonic for that is.
@robiniddon7582
@robiniddon7582 4 ай бұрын
BTW, I agree, excellent video. 👍
@johnwilliams7999
@johnwilliams7999 4 ай бұрын
great video it almost seems comprehensible! What is this asm used for on this device?
@fmbroadcast
@fmbroadcast 4 ай бұрын
WOoooooOW I love your CRT's !!!!!
@ReedHarston
@ReedHarston 2 ай бұрын
Copland OS theme? G3 iMacs?! ARM?!? Instant subscribe!
@thejintent2770
@thejintent2770 4 ай бұрын
I love the XP rice 😂
@yogxoth1959
@yogxoth1959 4 ай бұрын
Tip: did you know that if you press the tab key, it inserts four spaces (actually a configurable number) for you?
@TheGmr140
@TheGmr140 3 ай бұрын
Really cool project 😊😊
@gregshonle2072
@gregshonle2072 4 ай бұрын
While passing arguments to a function in registers is the fastest method, the downside is maintaining the code. Many (probably older) C compilers let you add the keyword "register" to the parameter, the compiler would (hopefully) pass it in a register. That being said, if a new parameter were to be added to the function (passed into the next register), and the function is using purely register manipulation, then all registers numbers in the function need to be manually updated. In the older days, many compilers passed all arguments on the stack, with it making easy to add new local variables also on to the stack. In regards to this video, it would be interesting to see a C++ to ARM video where the assembly language function has local variables...
@DrJohn123
@DrJohn123 4 ай бұрын
There is this other version of the gcd algorithm, where you subtract the smaller number from the larger until both are equal. Do you think this would be easier to code in assembly? Great video btw!
@AdamS-lo9mr
@AdamS-lo9mr 4 ай бұрын
Is recursion in c++ different than recursion in assembly? I think if you had a variable in the original c++ function then there would be another instance of the variable for every calling of the gcd functions, correct? The assembly version would not have this, and kinda works more like a regular loop. Thinking of it idk how you would do something like this in assembly if you really needed to keep track of some different data for each instance of the function.
@josvromans
@josvromans 2 ай бұрын
Took me a while to realize the whispering at the start reminds me of 'AIR - How Does It Make You Feel? ' Had to re play that at least 5 times, and then walked around for a bit, before I knew what it reminded me of.
@mrrolandlawrence
@mrrolandlawrence 4 ай бұрын
Wow not programmed assembler since my A440 days :) that was ARM v2. Good times.
@alexandermcalpine
@alexandermcalpine 4 ай бұрын
Great post!
@tylerdmace
@tylerdmace 4 ай бұрын
This is maybe the best video I've ever seen. Present day. Present time. Hahahahaha.
@Alberto_Cavalcante
@Alberto_Cavalcante 3 ай бұрын
+1 subscriber. This is awesome!
@jonshouse1
@jonshouse1 4 ай бұрын
Interesting, nicely done. I don't know how old you are, but I suspect I last wrote ARM assembler before you where born. Wrote code on the Acorn Archimedes in 1990ish. Personally I can't write assembler any better than GCC can generate it, I sometimes use gcc -S to have a peek under the hood but have not had any need to write ARM assembler in many years. Nice to see it done though, thanks.
@constantinknab
@constantinknab 4 ай бұрын
legendary tutorial
@langezeit6926
@langezeit6926 4 ай бұрын
You mixed up r1 and r0 and said a is stored in r1 and b in r0 even though the code says the opposite, in the part of the modulus implementation
@kamertonaudiophileplayer847
@kamertonaudiophileplayer847 4 ай бұрын
It's a great video, but can you use the same color palette as for C code for Assembler? Thanks.
@chrisblevins4502
@chrisblevins4502 3 ай бұрын
Great Video!
Dynamically Analyzing Linux Black Basta Ransomware
24:33
LaurieWired
Рет қаралды 17 М.
Mastering Memory: Allocation Techniques in C, C++, and ARM Assembly
17:05
Como ela fez isso? 😲
00:12
Los Wagners
Рет қаралды 34 МЛН
How many pencils can hold me up?
00:40
A4
Рет қаралды 20 МЛН
What ACTUALLY happens during a Stack Overflow?
12:43
LaurieWired
Рет қаралды 129 М.
The Magic of RISC-V Vector Processing
16:56
LaurieWired
Рет қаралды 168 М.
how NASA writes space-proof code
6:03
Low Level Learning
Рет қаралды 2,1 МЛН
I built my own 16-Bit CPU in Excel
16:28
Inkbox
Рет қаралды 1,4 МЛН
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 974 М.
I made the same game in Assembly, C and C++
4:20
Nathan Baggs
Рет қаралды 644 М.
Cybersecurity "Experts" suck at coding.  It's a problem.
15:12
LaurieWired
Рет қаралды 96 М.
3 Types of Algorithms Every Programmer Needs to Know
13:12
ForrestKnight
Рет қаралды 441 М.
The purest coding style, where bugs are near impossible
10:25
Coderized
Рет қаралды 876 М.
Comparing C to machine language
10:02
Ben Eater
Рет қаралды 5 МЛН
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 3,3 МЛН
Дени против умной колонки😁
0:40
Deni & Mani
Рет қаралды 10 МЛН
Интереснее чем Apple Store - шоурум BigGeek
0:42
С Какой Высоты Разобьётся NOKIA3310 ?!😳
0:43
keren sih #iphone #apple
0:16
Muhammad Arsyad
Рет қаралды 529 М.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 11 МЛН