Version 1.1.5 · Free

sim_6502

An interactive 6502 / 65C02 microprocessor simulator — registers, a hex memory view, a live disassembler, an ATASCII text screen and a keyboard, all in one front panel.

sim_6502 running in dark mode, showing the memory, disassembly and screen panes side by side

Overview

sim_6502 is a desktop simulator for the classic MOS 6502 and the enhanced WDC 65C02 microprocessors. It runs a CPU over a flat 64 KB of memory and wraps it in an interactive front panel: you can watch the registers, flags and cycle counter update live, scroll a hex dump of all of memory, follow a disassembly of the program, and see output on a simulated 40×32 text screen with an Apple II-style keyboard interface at 0xC000 and 0xC010.

Load programs as Intel HEX files, paste raw bytes, or write code straight into memory, then run at full speed or single-step one instruction at a time while the memory and disassembly views track the program counter. It ships with several ready-to-run examples — including a machine-language monitor and a small Tiny BASIC interpreter that can save and load programs to your filesystem.

The simulator implements every documented NMOS 6502 opcode (with the period-correct indirect-JMP bug), a switchable 65C02 mode with its extra instructions and fixes, and hardware interrupts (NMI / IRQ). Choose a light or dark theme and your preferred font from the in-app settings.

Downloads

Release 1.1.5 — pick the build for your operating system.

Linux

sim_6502 AppImage

Portable AppImage · ~9.9 MB · x86-64

⬇ Download AppImage

Make it executable and run it:
chmod +x sim_6502_1.1.5.AppImage
./sim_6502_1.1.5.AppImage

macOS

sim_6502 disk image

Apple disk image (.dmg) · ~16.6 MB

⬇ Download .dmg

Open the .dmg and drag sim_6502 to Applications. The build is unsigned, so on first launch you may need to right-click the app and choose Open, or allow it under System Settings → Privacy & Security.

Windows

sim_6502 MSIX Installer

Microsoft MSIX format installer (.msix) · ~16.6 MB

⬇ Download .msix

Double click the .msix file to install. The build is unsigned, you will need to deal with the Microsoft warnings to install.

Examples

Example programs

Assembler source, Intel HEX and BASIC files · .tar.gz

⬇ Download examples (.tgz)

The programs bundled with the app — demo_sum, the maze_10print "10 PRINT" maze, the monitor, tinybasic, and the forth interpreter — as py6502 assembler source plus assembled .hex, along with samples PROGRAM.BAS and SNOW.BAS. Unpack with tar xzf examples_1_1_5.tgz, then load a .hex with "Open .hex file".

Web

Run in your browser

No download · runs on desktop and mobile browsers

▶ Launch sim_6502

The full simulator, compiled to WebAssembly, hosted at deadhat.com/sim_6502_app. File loading and SAVE/LOAD use your browser's file picker.

Both desktop builds also accept a hex file on the command line, e.g. sim_6502 program.hex, to load it at startup.

A quick tour

A walk through the simulator, from the front panel to loading and running a BASIC program.

1

The front panel (dark mode)

On a wide window the Memory, Disassembly and Screen views sit side by side. Along the top are the registers and flags, the view toggles, the 6502 / 65C02 switch and the cycle counter; along the bottom are the Pause, Step, Run, NMI and IRQ controls. The Screen pane shows the start-up demo and an on-screen keyboard.

sim_6502 in dark mode with all three views
2

Light mode

The same layout in light mode — selectable from the Settings dialog. The chrome and the memory/disassembly text adapt to the theme, while the simulated screen keeps its green-on-black "CRT" look.

sim_6502 in light mode
3

The toolbar

From the toolbar you can open Settings (gear), paste hex bytes, open an Intel HEX file (folder), save all 64 KB of memory to a hex file (floppy disk), reset the CPU, and reload the demo. Here the cursor is hovering the "Open .hex file" button.

The sim_6502 toolbar with the Open .hex file button highlighted
4

Choosing a program

"Open .hex file" brings up the system file picker. The release ships with a set of example programs — demo_sum, the maze_10print "10 PRINT" maze, a monitor, and tinybasic — as both assembler source and assembled Intel HEX.

The file picker showing the bundled example programs
5

The simulated screen

The Screen tab is a 40×32 character display mapped to memory $0800–$0CFF. Each byte is one ATASCII character, with inverse video for high-bit bytes. This is the start-up demo: a title, the inverse-video line, and a row of block-graphics glyphs.

The 40x32 ATASCII text screen showing the demo content
6

Running Tiny BASIC

Load tinybasic.hex and press Run: the screen shows the TINY BASIC banner and a > prompt, ready for you to type. The register bar shows the CPU spinning in its keyboard-poll loop while it waits for input.

Tiny BASIC running, showing its prompt
7

LOAD from the filesystem

Tiny BASIC can read and write programs to real files. Typing LOAD at the prompt opens the host file picker so you can choose a saved .BAS program.

The LOAD command opening a file picker
8

Picking a BASIC program

Select a program — here PROGRAM.BAS — and the bytes are streamed back into the interpreter through its file-I/O ports.

Selecting PROGRAM.BAS to load
9

LIST the program

After loading, LIST shows the program. This one clears the screen and uses a FOR/NEXT loop with the CXY cursor-positioning command to draw a pattern.

A LIST of the loaded BASIC program
10

RUN it

RUN executes the program, drawing a diagonal line of * characters across the screen — output produced by 6502 code writing to screen memory, rendered live.

The BASIC program running, drawing a diagonal of stars
11

Single-stepping

Turn on the Memory and Disassembly views and press Step to execute one instruction at a time. Both views follow the program counter — the current instruction is highlighted in the disassembly — so you can watch exactly how the interpreter does its work while the screen updates alongside.

Single-stepping with memory, disassembly and screen visible

Details

The information below is from the project's README.

CPU

Front panel

Tabbed views

Each tab remembers its scroll position when you switch away and back, and PC-following keeps the current instruction in view while stepping or running.

Breakpoints

Two kinds of breakpoint pause a Run:

Resuming with Run steps past the breakpoint it stopped on. The Settings dialog has a Delete all breakpoints option that clears every breakpoint when you press OK.

Keyboard (Apple II style)

The Screen tab includes an on-screen keyboard, and physical keystrokes are captured while that tab is focused. Keys are presented to the program through an Apple II-style interface:

A typical reader loop is LDA $C000 / BPL wait / ... / LDA $C010.

Loading programs

Example programs

The simulator ships with ready-to-load programs (assembler source in the py6502 format, plus the assembled Intel HEX):

Platforms

sim_6502 is built with Flutter and targets iOS, Android, macOS, Linux, Windows, and the web. The application identifier is com.deadhat.sim_6502. The downloads above are the Linux and macOS desktop builds; on macOS the app sandbox is disabled so it can read a hex file given on the command line.

NMOS 6502 WDC 65C02 64K memory Intel HEX ATASCII screen Apple II keyboard NMI / IRQ Tiny BASIC

Assembler

The simulator does not include an assembler — it loads pre-assembled Intel HEX files. To turn assembly source into a .hex you can load, a Python-based 6502 / 65C02 assembler is available at github.com/dj-on-github/py6502. The bundled example programs are written in its syntax.