Skip to content

Latest commit

 

History

History
70 lines (53 loc) · 4.19 KB

introduction.md

File metadata and controls

70 lines (53 loc) · 4.19 KB

Computers aren't very smart


This may sound counterintuitive, but computers aren't very smart. I know you may be shaking your head, insisting that my statement can't possibly be true, but I promise you that literally everything your computer is doing can be represented with just two values: 0 and 1.

Now here's the catch - I said they're fundamentally simple, but I didn't say they're always easy to understand. Even though computers are, at their core, doing fairly simple tasks, they can be seriously confusing to learn about! We have to remember that computers have been built up layer by layer over a long period of time. These layers have produced the amazing, efficient, incredible machines that we use today. But, these layers also make learning about computers feel like a serious nightmare sometimes, because there's just so much to learn about.

I will say that communicating with your CPU directly is generally quite unnecessary, as we now have higher level languages that are fast enough for most of our needs. That being said, the game RollerCoaster Tycoon is written 99% in assembly language.

Not only that, but if you're:

  • making operating systems
  • writing game engines
  • doing cryptography
  • making drivers
  • a hacker making a virus (eep!)

Then you're often writing assembly directly because you need access to the lowest levels of your computer, and you need things to be lightning fast.



A screenshot of RollerCoaster Tycoon


Even though you or I may never need to write assembly, I think that building an understanding of how your computer works at this level can be pretty dang empowering, and can help you appreciate all of the other stuff you do on your computer. In fact, the minute I wrote another program after writing in assembly, I was so happy it wasn't assembly. Writing programs in assembly, as you'll come to learn, is very manual - you have to account for every single thing yourself. Sorry assembly, I still love you!

It's kind of like being a race car driver. Race car drivers don't technically need to understand what their car is doing under the hood; they can just use the steering wheel, brake pedal, and other high-level abstractions to do their job. However, if they have a lower-level understanding of what their engine, brakes, wheels, and other mechanical things are doing, they can use that knowledge to be even better at their job. For example, they could be in a race and hear a noise or notice a smell. Someone who hadn't learned about their car may ignore that sign, but those indicators could mean that something is happening at a lower level in their car that they should address - maybe the engine is under strain, or the brakes need a lighter touch at that moment.

I hope this guide helps you to demystify some of the lowest layers, and turn it from something that feels like magic to something that feels graspable. I personally didn't know how these things worked before I started writing this guide, and I wanted to turn the things I pieced together during my learnings into something that can help others on their journey.



Alright, let's get to the good stuff. Like, what even is a CPU? →



Made with love by Hack Club