Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Practice build · Operating systems and the machine

Build your own Virtual Machine

An emulator for the LC-3 teaching computer (or the CHIP-8 game console) that runs real programs.

  • Intermediate
  • About 6–12 h
  • 4 checkpoints
  • 3 tutorials · C, C++

Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.

Choose a tutorial

Why build it

An emulator is a loop that fetches, decodes and executes instructions. Building one explains registers, binary encoding and memory-mapped I/O, and connects software to hardware.

You will be able to

  • Decode binary instructions with masks and shifts.
  • Model registers, memory and condition flags.
  • Implement memory-mapped I/O and trap routines for the keyboard and screen.
  • Load and run real program images.

Skills it exercises

Recommended on Operating Systems & Linux and Data Structures & Algorithms.

Checkpoints

How you know you are there

Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.

  1. Checkpoint 1Self-check

    Fetch, decode, execute

    Done when: The VM loads an image and executes ADD, LD and BR, with a unit test for each opcode.

  2. Checkpoint 2Self-check

    Every opcode

    Done when: All instructions of the architecture are implemented and tested.

  3. Checkpoint 3Self-check

    I/O

    Done when: Trap routines read keys and print characters, with the terminal in raw mode.

  4. Checkpoint 4Self-check

    Real programs

    Done when: 2048 or Rogue (LC-3), or a CHIP-8 game, is playable in your VM.

Stretch goals

  • A disassembler and a single-step debugger for your VM.
  • A Game Boy emulator as the next, much larger step.
Follow a tutorial

Step-by-step guides

Pick one in a language you know (tutorial languages: C, C++). They open on the author’s site.

Where to go next

Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.

Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.