sql-hkr

tiny8: Simulate an 8-Bit CPU and Visualize Assembly

Tiny8 is a Python-based 8-bit CPU simulator for learning computer architecture through assembly programs and interactive debugging. Use it to inspect CPU state step by step or generate execution animations for teaching and demonstrations.

View on GitHub Compare
Stars
1.4k
Forks
39
Stars, last 30 days
+10

Our take

Health score

20/100

How it is scored
Activity
35
Community
4
Issues
21
Pull requests
20

+10 stars in the last 30 days

  • Fewer contributors than 91% of the projects we track

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

1,396

Forks

42

Change since Nov 16, 2026: +1 stars·0 forks

Overview

Tiny8 is an educational CPU simulator that lets learners write assembly and observe how instructions change registers, flags, and memory. It provides an AVR-inspired 8-bit architecture, an assembler, and a Python API without heavy dependencies.

It is a good fit when the goal is to make low-level execution visible, such as in a computer architecture lesson or while experimenting with simple algorithms. It is a simulator, not a tool for running software on physical AVR hardware.

Key Features

  • Assemble and run programs written in Tiny8 assembly.
  • Step through execution in a terminal debugger, with register, flag, and memory change highlighting.
  • Search execution history and navigate using steps, marks, and PC addresses.
  • Generate GIF or MP4 visualizations of program execution.
  • Explore an AVR-inspired CPU with 32 general-purpose registers, an 8-bit ALU, status flags, and stack operations.
  • Use the Python API to assemble programs, run the CPU, and inspect registers or RAM.
  • Try included examples such as Fibonacci, bubble sort, and factorial.

Use Cases

  • Students can connect assembly instructions to changes in CPU state while learning computer architecture.
  • Educators can demonstrate instruction execution with the debugger or create animations for lessons.
  • Hobbyists can experiment with low-level algorithms in a small, inspectable simulator.
  • Python developers can run sample assembly programs and inspect their results through the API.

Getting Started

Install from PyPI:

pip install tiny8

Run an assembly file with tiny8 program.asm. See the README for debugger controls, CLI options, examples, and API details.

Considerations

Tiny8 models its own educational architecture and assembly environment, so its AVR inspiration does not make it a drop-in AVR emulator. The debugger requires WSL or windows-curses on Windows, while animation mode works natively. The repository includes a CI badge and tests, but this summary does not establish broader production readiness.

Found this useful?

Share it with someone who would like tiny8.