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 readDisplay
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 buttonThe byte is read-only: writing to it stops the program. 0x3FF0–0x3FFE read 0 and are reserved.
Code
Registers
CPU halted
Disassembly
| Breakpoint | Addr | Instruction | Bytes |
|---|---|---|---|
| 0000 | NOP | 00 | |
| 0001 | NOP | 00 | |
| 0002 | NOP | 00 | |
| 0003 | NOP | 00 | |
| 0004 | NOP | 00 | |
| 0005 | NOP | 00 | |
| 0006 | NOP | 00 | |
| 0007 | NOP | 00 | |
| 0008 | NOP | 00 | |
| 0009 | NOP | 00 | |
| 000A | NOP | 00 | |
| 000B | NOP | 00 | |
| 000C | NOP | 00 | |
| 000D | NOP | 00 | |
| 000E | NOP | 00 | |
| 000F | NOP | 00 | |
| 0010 | NOP | 00 | |
| 0011 | NOP | 00 | |
| 0012 | NOP | 00 | |
| 0013 | NOP | 00 | |
| 0014 | NOP | 00 | |
| 0015 | NOP | 00 | |
| 0016 | NOP | 00 | |
| 0017 | NOP | 00 |
Memory
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0000 | ||||||||||||||||
| 0010 | ||||||||||||||||
| 0020 | ||||||||||||||||
| 0030 | ||||||||||||||||
| 0040 | ||||||||||||||||
| 0050 | ||||||||||||||||
| 0060 | ||||||||||||||||
| 0070 | ||||||||||||||||
| 0080 | ||||||||||||||||
| 0090 | ||||||||||||||||
| 00A0 | ||||||||||||||||
| 00B0 | ||||||||||||||||
| 00C0 | ||||||||||||||||
| 00D0 | ||||||||||||||||
| 00E0 | ||||||||||||||||
| 00F0 |
PCSPchangeddisplay (0x4000–0x9FFF)input (0x3FF0–0x3FFF)