sicp.io
Back to the course

Chapter 5 · Computing with Register Machines

23 runnable lessons across 5 sections of the original book.

Start

Section 5.1 · Designing Register Machines

6 lessons

  1. 5.1.1Controller text names data paths, operations, and control transfers.Open lesson
  2. 5.1.2Keep the controller stable while operations and storage change.Open lesson
  3. 5.1.3One controller segment can return to more than one caller.Open lesson
  4. 5.1.4A stack remembers what must happen after return.Open lesson
  5. 5.1.5Evaluator control becomes registers, labels, and stack protocol.Open lesson
  6. 5.1.6Each instruction has an explicit data, stack, and control contract.Open lesson

Section 5.2 · A Register-Machine Simulator

6 lessons

  1. 5.2.1Registers make every changing value explicit.Open lesson
  2. 5.2.2A program counter turns control into data.Open lesson
  3. 5.2.3The program counter turns assembled instructions into a machine run.Open lesson
  4. 5.2.4A label table turns names into instruction positions.Open lesson
  5. 5.2.5Assembly can move instruction dispatch out of the run loop.Open lesson
  6. 5.2.6The machine can report the work its controller performed.Open lesson

Section 5.3 · Storage Allocation and Garbage Collection

3 lessons

  1. 5.3.1A pair can be an address into parallel car and cdr vectors.Open lesson
  2. 5.3.2Copy live cells, forward repeated references, and leave garbage behind.Open lesson
  3. 5.3.3A root set separates reachable objects from unused allocations.Open lesson

Section 5.4 · The Explicit-Control Evaluator

0 lessons

    Section 5.5 · Compilation

    8 lessons

    1. 5.5.1Dispatch by syntax, honor target and linkage, compose instruction contracts.Open lesson
    2. 5.5.2Source forms become instruction tags before execution begins.Open lesson
    3. 5.5.3Compile the operator first, preserve argument order, cross one apply boundary.Open lesson
    4. 5.5.4Save only the register the next sequence still needs.Open lesson
    5. 5.5.5Recursive compiled code makes every call and return transfer explicit.Open lesson
    6. 5.5.6A lexical address replaces a name search with two indexes.Open lesson
    7. 5.5.7One apply boundary can connect two procedure representations.Open lesson
    8. 5.5.8A compiler changes the representation of the work.Open lesson

    Chapter checkpoint

    Reconnect the chapter’s key ideas before moving on.

    Review