16 bytes of x86 code generates Sierpinski fractals with Matrix-style visuals
Original: 16 bytes of code that turn Sierpinski waves into Matrix rain
Why This Matters
Demonstrates extreme optimization in demoscene programming and mathematical beauty in minimal code
Demoscene coder hellmood created a 16-byte x86 assembly program that simultaneously generates Sierpinski triangle patterns as both Matrix-style rain visuals and PC speaker audio. Released at Outline Demoparty 2026.
The program uses just 16 bytes of x86 real-mode DOS assembly to create an infinite Sierpinski fractal that appears as Matrix-style rain on screen while generating corresponding audio through the PC speaker. The code initializes video mode 0 (40x25 text), points to VGA text buffer memory at 0xb800, then runs a tight loop that loads bytes, performs XOR operations, and outputs to the speaker. Each timestep plays and draws another Sierpinski triangle line with a stepsize of 56 pixels. The visual effect works because the 8192-pixel-wide pattern is compressed into 80-character screen lines, creating the flowing appearance. The programmer noted this builds on their 2014 'M8trix' demo but adds synchronized audio. The code exploits BIOS screen clearing behavior where memory contains 0x20 (space) and 0x07 (color) rather than zeros, plus polymorphic assembly instructions and mid-instruction jumps for extreme size optimization.