| Home | Classes | Papers | Essays | Short Fiction | About |

Table of Contents

Compilation & Execution

In a previous lecture, we discussed a little bit about computer architecture. We learned that we can think of a computer as a machine which takes input, performs calculations based on that input, and returns output. What we're primarily interested in in this class is how we can write the "input" that the computer will use to perform calculations.

What is Machine Code?

Computers come in many different shapes and sizes, but, at base, they all follow the exact same design philosophy: there will be some internal unit which will read instructions to perform actions. In the case of a modern personal computer that philosophy is concretized by the Central Processing Unit (CPU). A familiar refrain is used by both the lowliest hacks and the holiest hackers in computer science, "The CPU is the brain of the computer". What they mean is that the CPU "drives" all of the components connected to the motherboard. All peripherals "listen" to what the CPU has to "say". But the CPU itself is "listening". What it's "listening" to are blocks of binary signals called words.

A typical, simplified CPU loop is as follows:

  1. Fetch a binary word representing an instruction1
  2. Decode that word to determine the desired operation
  3. Execute the operation

This loop is performed for as long as the CPU is powered on.

What is Assembly Code?

What is Compilation?

What is a Compiler?

  • GCC

What are Compilation Tools?

  • Make

Exercises

Footnotes:

1

Instructions will come from a component called the Instruction Cache, or I-Cache.

Contact: [email protected] | rss feed | Compiled with org-mode