Skip to content
Tech News
← Back to articles

WriteUp: 16 Bytes of x86 that turn Matrix rain into sound

read original get USB MIDI Controller → more articles
Why This Matters

This innovative 16-byte x86 assembly code demonstrates how extreme code compression can produce complex visual and audio effects, pushing the boundaries of algorithmic density in the demoscene. Its ability to generate fractal visuals and sound from minimal code highlights the potential for highly efficient programming and creative technical expression, inspiring both developers and consumers interested in the limits of digital art and computation.

Key Takeaways

wake up! 16b

Released at the Outline Demoparty in May 2026, Ommen, NL

An exploration of algorithmic density in 16 bytes of x86 assembly.

In the demoscene, exploring what can be achieved within extreme constraints is a rewarding technical challenge. The following 16 bytes of x86 real-mode DOS assembly code represent a careful exercise in algorithmic density. When executed, it utilizes the computer's video memory as a calculation space to draw an infinite Sierpinski fractal, while simultaneously interpreting that geometry as audio data.

int 10h ; 2 bytes mov bh, 0xb8 ; 2 bytes mov ds, bx ; 2 bytes L: lodsb ; 1 byte sub si, byte 57 ; 3 bytes xor [si], al ; 2 bytes out 61h, al ; 2 bytes jmp short L ; 2 bytes

1. The Canvas: A Primed Void

The code begins with a standard BIOS interrupt: int 10h . This initializes Video Mode 0, establishing a 40x25 text mode grid. The subsequent instructions point the Data Segment ( DS ) to 0xB800 , the physical memory address of the VGA/CGA text buffer.

When the BIOS clears the screen during this interrupt, it does not fill the memory with absolute zeroes. In text mode, every character space consists of two bytes: the ASCII character and the color attribute. The BIOS initializes all 2,000 character slots uniformly: the ASCII byte is set to 0x20 (the Space character), and the color byte is set to 0x07 (Light Gray text on a Black background). While the screen appears completely empty, it is actually a canvas primed with a uniform pattern of data.

The Importance of Uniformity: The mathematical progression we are about to explore relies on a predictable environment. If the memory contained random artifact data, the algorithmic calculations would ingest those discrepancies. In a cellular automaton, an unexpected bit can disrupt the pattern. A reasonably uniform memory space provides a foundation for the fractal to emerge clearly.

2. The Engine: Additive Prefix Sums

... continue reading