Skip to content
Tool

Z80 Emulator

A Zilog Z80 computer that runs in your browser, written in Rust and compiled to WebAssembly. Write assembly or C, load it into memory, then step or run it at any clock speed while you watch the registers, memory, disassembly, and a 192×128 memory-mapped display.

How it works — Inside the Z80 Emulator, 11 min read

Display

192×128 pixels at 0x4000–0x9FFF, one byte each: RRRGGGBB.

Input

How the buttons work

Hold a key, or click the pad and use the arrow keys and 1–4. A program reads them as one byte at 0x3FFF, a bit per key, while it runs:

bit   7  6  5  4   3  2  1  0
      4  3  2  1   R  L  D  U

AND 0x0F → any arrow    AND 0xF0 → any button

The byte is read-only: writing to it stops the program. 0x3FF0–0x3FFE read 0 and are reserved.

Code

Registers

Flags (F)

CPU halted

Disassembly

BreakpointAddrInstructionBytes
0000NOP00
0001NOP00
0002NOP00
0003NOP00
0004NOP00
0005NOP00
0006NOP00
0007NOP00
0008NOP00
0009NOP00
000ANOP00
000BNOP00
000CNOP00
000DNOP00
000ENOP00
000FNOP00
0010NOP00
0011NOP00
0012NOP00
0013NOP00
0014NOP00
0015NOP00
0016NOP00
0017NOP00

Memory

0123456789ABCDEF
0000
0010
0020
0030
0040
0050
0060
0070
0080
0090
00A0
00B0
00C0
00D0
00E0
00F0

PCSPchangeddisplay (0x4000–0x9FFF)input (0x3FF0–0x3FFF)

Ready.

All projects