A custom 16-bit RISC ISA, an assembler and cycle-accurate emulator written in Rust, compiled to WebAssembly, and wired to an animated datapath diagram.
✓ Running purely in the browser. Zero dependencies.
Every layer built from scratch
Custom ISA, two-pass assembler, ALU, memory subsystem, and cycle-accurate fetch-decode-execute, all unit-tested natively then compiled to WASM.
A thin JS boundary exposes Rust-defined functions. Each step returns a structured delta.
SVG datapath with wire animations driven by the step delta. CodeMirror editor with a custom assembly syntax highlighter.
Experiments, live in the browser
12 instructions. Turing complete.
| Opcode | Mnemonic | Syntax | Semantics |
|---|---|---|---|
| 0000 | ADD | ADDRDRS1RS2 | RD ← RS1 + RS2; set Z |
| 0001 | SUB | SUBRDRS1RS2 | RD ← RS1 − RS2; set Z |
| 0010 | AND | ANDRDRS1RS2 | RD ← RS1 & RS2; set Z |
| 0011 | OR | ORRDRS1RS2 | RD ← RS1 | RS2; set Z |
| 0100 | NOT | NOTRDRS1 | RD ← ~RS1; set Z |
| 0101 | LOADI | LOADIRDIMM6 | RD ← sign-extend(IMM6); set Z |
| 0110 | LOAD | LOADRDRS1 | RD ← MEM[RS1] |
| 0111 | STORE | STORERS1RS2 | MEM[RS2] ← RS1 |
| 1000 | JMP | JMPADDR9 | PC ← ADDR9 |
| 1001 | JMPZ | JMPZADDR9 | PC ← ADDR9 if Z |
| 1010 | ADDI | ADDIRDRS1IMM6 | RD ← RS1 + sign-extend(IMM6) |
| 1111 | HALT | HALT | Stop execution |
Write assembly, compile it on the fly, and watch the electrical signals flow through the datapath on every clock cycle.