6502 by dbhqGitHub

Built in public

A 6502, built in the open

A cycle-accurate 6502 and 65C02 core in C#, and the machines it will run, as many as possible, each one proven. Every step of the work is written down here, as it happens.

Illustration of a microprocessor die
Illustration of a microprocessor die. Not a photograph of the 6502.

Status

Where it stands

Every figure on this page comes from the latest test run, whose commit is shown below, or from a dated measurement. None is typed by hand.

0 of 51

Machines implemented

A machine counts only once it runs in the browser and passes an automated test.

5

Variants of the core

The NMOS 6502, the NES's 2A03, and three 65C02s.

1,480

Tests passing

From the latest test run, on the commit shown below.

24.4 times

Against a 2 MHz machine, in the browser

Compiled ahead of time, best of 5 runs, on one machine, collected 30 Sept 2026. The design target is at least 25 times real speed, for the core alone. Against this site's 2 MHz reference it is met natively and not yet met in the browser.

Test run on commit 1393d10.

Proof

A difference is a number, not an argument

The core is checked against Tom Harte's SingleStepTests, a published record of every opcode's bus activity, cycle by cycle. When something differs, the test names the cycle and the byte.

Where it knowingly differs from a reference, that is written down too.

dotnet test
Passed Nmos6502Harte: 256
Passed Ricoh2A03Harte: 256
Passed Rockwell65C02Harte: 256
Passed Synertek65C02Harte: 256
Passed Wdc65C02Harte: 254
Passed!  - Failed: 0, Passed: 1,480, Skipped: 0

Machines

The machines this core is for

The first three, and the whole family in the table.

Planned

KIM-1

1976, 6502, 1 MHz

Planned

BBC Micro

1981, 6502, 2 MHz

Planned

NES, Famicom

1983, Ricoh 2A03 (NTSC), 2A07 (PAL)

All 56 machines in the family

Journal

From the journal

What was decided, what was checked, what went wrong and why.

Building the site

The Astro site for 6502.dbhq.uk is built one task at a time, starting with a registry of machines that a test keeps in step with the family document.

The programme changes shape

The site's look, its imagery, and a mission that grew from three machines to as many as possible.

The browser speed check

How fast the core runs in a browser, interpreted and compiled ahead of time, measured on one machine.

Illustration: the textured backgrounds behind the proof and machines sections are generated, not measurements

This site uses Google Analytics to count how many people read these pages. No cookie is set unless you accept, and every page works exactly the same either way.