An Introduction to Machine Language

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ธ.ค. 2024

ความคิดเห็น • 22

  • @leonid998
    @leonid998 8 หลายเดือนก่อน

    9:50 Hi! If I'm correct both example c and java loops involve conditional branch on every iteration. The difference is mainly in loop header location(compiled program text-wize) relative to the loop body and hence the direction we jump or not jump when loop condition is true. I believe C strives to satisfy branch predictor implementation that would conventionally first predict backwards branch as taken. Additionally C variant has one branch instruction less for every iteration except for loop preheader.
    P.s. great videos! Thank you for them!

    • @wizardcraftcode
      @wizardcraftcode  8 หลายเดือนก่อน +1

      I don't disagree with anything you said. Different branch prediction algorithms would react to each differently, so I'm not sure either one is optimized for that. Thanks for your comment! The subtleties of these things are really interesting and I love the discussion!

  • @lucx
    @lucx 11 หลายเดือนก่อน +1

    What made the C assembly look unnecessarily complicated was the lack of formatting. You could have used spaces, better alignment with tabs, and base 10 digits for the purposes of this tutorial.

    • @wizardcraftcode
      @wizardcraftcode  11 หลายเดือนก่อน +1

      Interesting point! I posted from a decompiler and didn't notice the inconsistent indentation. Next time, I'll be more careful. Thanks for the feedback!!

  • @psikeyhackr6914
    @psikeyhackr6914 3 ปีที่แล้ว +2

    The term:
    "von Neumann architecture"
    is used intermittently and inconsistently in computer science. Most sources that use it have crappy explanations, and most sources with good explanations don't use it.
    IBM hired John von Neumann as a consultant in 1951. I was hired in 1978. The entire time I was there I never heard or saw any mention of him or his namesake.
    Of course Eckert and Mauchley may have thought of it before he did, but von Neumann got all the credit.

    • @wizardcraftcode
      @wizardcraftcode  3 ปีที่แล้ว +1

      You are absolutely correct! In academia, we use von Neumann architecture really vaguely. It drives me nuts when colleagues call our current multi-core/multi-processor systems "von Neumann machines!" While you were working at IBM, I was building mainframes with Burroughs. We NEVER called our machines von Neumann machines! :D

    • @psikeyhackr6914
      @psikeyhackr6914 3 ปีที่แล้ว +1

      @@wizardcraftcode "Merlin"
      Great name!
      Any sufficiently advanced technology is indistinguishable from magic.
      A "von Neumann machine" is what von Neumann called a "universal constructor". Beat an academic every chance you get.
      Have you checked out Dennis Taylor's Bobiverse? LOL

  • @mtushar
    @mtushar 3 ปีที่แล้ว +1

    Very insightful. Thanks Merlin!

  • @G45
    @G45 3 ปีที่แล้ว +1

    Thank you Merlin for this great tutorial

  • @noevelasquez5109
    @noevelasquez5109 ปีที่แล้ว

    Thanks Merlin...very helpful tutorial !!!

  • @noevelasquez5109
    @noevelasquez5109 ปีที่แล้ว

    Very helpful tutorial

    • @carolwellington483
      @carolwellington483 ปีที่แล้ว

      Thank you!

    • @wizardcraftcode
      @wizardcraftcode  8 หลายเดือนก่อน

      Apparently, I replied from the wrong account! Thanks from this one, too!

  • @edwardsantiago6433
    @edwardsantiago6433 ปีที่แล้ว

    Excellent work.

  • @fanyang6795
    @fanyang6795 6 หลายเดือนก่อน

    Does this mean C will perform better than Java for while loops at scale?

    • @wizardcraftcode
      @wizardcraftcode  6 หลายเดือนก่อน

      Unfortunately, it isn't that easy! There are way too many other factors that affect the actual run-time. For example, much of the effect I'm talking about here can be overwhelmed by branch-prediction algorithms in the CPU. If you have a loop that runs a zillion times, those algorithms will prevent the flushes because it will correctly guess that the loop will jump to the top. If that speed was critical, I'd have to build both and do an empirical study to be sure who was going to win. Thanks for a great question! I hope you find more videos valuable, too!

    • @fanyang6795
      @fanyang6795 6 หลายเดือนก่อน

      @@wizardcraftcode thanks for this clarification, I was just learning about the branch-predication from your CPU pipeline intro. Very grateful for this series!

    • @wizardcraftcode
      @wizardcraftcode  6 หลายเดือนก่อน

      I'm really glad you find them helpful!!!