Chips › Processors › Esoteric & theoretical › Subleq (OISC)
Subleq (OISC)
1988
A one-instruction set computer whose sole operation, subtract-and-branch-if-less-or-equal, is enough to compute anything.
Subleq (OISC) Online Emulator
Play Subleq (OISC) using JavaScript directly in your browser.
Controls
Boots printing "Hello, world!" — the whole program is 60 SUBLEQ words. It runs to a halt (subleq Z,Z,-1) in a handful of steps; use the debugger to single-step the one instruction, set breakpoints on the instruction pointer, and watch Mem[B] change. Type into the input box (or the on-screen keyboard) to feed the IN stream.
Configurations
| Configuration | Emulator | Machine | OS | Legal | |
|---|---|---|---|---|---|
| Hello, world! | Subleq | Subleq (OISC) | open | Open ⛶ |
Machines
Emulators
| Emulator | Type | License | Site |
|---|---|---|---|
| Subleq | online | Public domain | Website ↗ |
| Subleq (Mazonka) | both | Freeware | Website ↗ |
Reference & documentation
External technical references for programming Subleq (OISC) and for writing emulators.
| Resource | Type | Notes |
|---|---|---|
| Subleq - Esolang Wiki ↗ | Instruction set | Canonical single-instruction spec, operands, Turing-completeness, variants |
| Subleq - Esolang Wiki ↗ | Memory map | Memory-mapped I/O: address -1 output, negative halt |
| Higher Subleq - Esolang Wiki ↗ | Programming | Typeless C-like language compiling to Subleq; stdlib details |
| SUBLEQ - A One Instruction Set Computer (TechTinkering) ↗ | Programming | sblasm macro assembler, self-modifying code, hello world |
| A Simple Multi-Processor Computer Based on Subleq (Mazonka & Kolodin) ↗ | Reference | Primary paper: architecture, FPGA array, C-to-Subleq compiler |
| howerj/subleq-vhdl - VHDL SUBLEQ CPU ↗ | Schematic | 16-bit VHDL CPU synthesized for Spartan-6 FPGA |
| davidar/subleq - Logisim CPU ↗ | Schematic | Logisim processor: three buses, six control signals |
| davidar/subleq - CPU design and toolchain ↗ | Source | Assembler libraries, C and JS interpreters, demos |
| jserv/subleq - Forth on a 16-bit SUBLEQ machine ↗ | Source | Optimized C VM with fused instructions, self-hosting eForth |
| howerj/subleq - eForth SUBLEQ system ↗ | Source | ~600-byte C virtual machine, self-hosting Forth image |
| kjh618/subleq-compiler ↗ | Tool | Higher-level assembly to Subleq compiler; mov/add/jmp directives |