WriteUp: 16 Bytes of x86 that turn Matrix rain into sound
HellMood
68 points
4 comments
May 17, 2026
Related Discussions
Found 5 related stories in 88.4ms across 8,303 title embeddings via pgvector HNSW
- Wake up! 16b MaximilianEmel · 137 pts · May 24, 2026 · 62% similar
- Show HN: A (marginally) useful x86-64 ELF executable in 298 bytes meribold · 12 pts · April 07, 2026 · 45% similar
- Computer-generated dream world: Virtual reality for a 286 processor MBCook · 38 pts · March 02, 2026 · 45% similar
- Random musings: 80s hardware, cyberdecks speckx · 28 pts · April 17, 2026 · 45% similar
- 80386 microcode disassembled nand2mario · 237 pts · May 23, 2026 · 43% similar
Discussion Highlights (3 comments)
HellMood
"wake up! 16b" (Outline Demoparty, May 2026, Ommen, NL) is a 16-byte MS-DOS production that uses video memory to calculate a Sierpinski fractal and play it as audio. Video: https://youtu.be/MvycyU-kLjg | Pouet: https://www.pouet.net/prod.php?which=106210 The 16-Byte Code: int 10h ; Init Video Mode 0 mov bh, 0xb8 ; Setup VRAM segment mov ds, bx L: lodsb ; Load [SI] to AL, inc SI sub si, 57 ; Move pointer backward xor [si], al ; Cellular Automaton out 61h, al ; PC Speaker output jmp short L ; Infinite loop 1. The Canvas: `int 10h` primes the 40x25 text grid uniformly with ASCII 0x20 and color 0x07. This stable, uniform void is necessary to prevent the cellular automaton from shattering into static. 2. The Fractal (Rule 60): If this loop used `add`, it would create a binomial prefix sum: A^(p)[k] = 2 \* C(k+p, p-1) mod 256 But substituting `add` with `xor` discards the arithmetic carry, isolating the bit-planes. This turns the math into a pure cellular automaton mapping to Wolfram's Rule 60: Cell^(p)[k] = Cell^(p-1)[k] XOR Cell^(p)[k-1] Visualizing Bit 1 propagation over 5 passes (X = set): P1: X X X X X X X X P2: . X . X . X . X P3: X . . X X . . X P4: . . . X . . . X P5: X X X . . . . X P6: . X . . . . . X P7: X . . . . . . X 3. The Audio: Port `61h` uses Bit 1 to physically move the PC speaker cone. The Sierpinski geometry acts directly as a square-wave audio instruction: alternating bits (like P2) yield high frequencies, while sparse rows (P4) create rhythmic rests. 4. The -56 Byte Step: The pointer's net movement is -56 bytes per loop. - Visuals: On an 80-byte wide grid, this offset shears the fractal diagonally into 10 evenly spaced, ascending vertical pillars. - Audio: 56 does not divide the 64KB segment evenly, requiring 8,192 steps (7 full wraps) to complete a cycle. Doubling the macro-cycle halves the fundamental frequency, dropping the audio exactly one octave. 5. Hardware Quirks: The theoretical math expects zeroed memory, but the XOR operation violently collides with the BIOS's 0x20/0x07 initialization. This mutates the pure triangles into a cascade of pseudo-random ASCII glyphs. Because it relies entirely on raw RAM states, the visual and auditory output is highly sensitive to the specific machine or emulator, turning a simple mathematical quirk into a unique audiovisual fingerprint.
Retr0id
How does the sierpinski fractal relate to the rain effect?
mati365
It must be magic. I don't believe it's possible in such short snippet of code.