← Retour au blog
tech 18 May 2026

WriteUp: 16 Bytes of x86 that Turn Matrix Rain into Sound

Discover how 16 bytes of x86 code transform a simple Matrix-like animation into intriguing sound. An exploration of algorithmic density at its peak.

Article inspired by the original source
WriteUp: 16 Bytes of x86 that turn Matrix rain into sound ↗ hellmood.111mb.de

Introduction

In the fascinating world of the demoscene, the art of optimization and technical creativity reaches its peak. The idea is simple: achieve wonders with minimal resources. Today, we delve into such a feat with a unique project: 16 bytes of x86 code that turn a Matrix-like animation into sound.

The Canvas: A Primed Void

The code begins with a standard BIOS interrupt: int 10h. This initializes Video Mode 0, setting up 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. This creates a predictable calculation space for drawing a Sierpinski fractal.

Why Uniformity is Crucial

Uniform memory is essential to ensure that algorithmic calculations are not disrupted by stray data. In a cellular automaton, an unexpected bit can disrupt the pattern. A reasonably uniform memory space allows the fractal to emerge clearly.

The Engine: Additive Prefix Sums

To understand the pure mathematics of the fractal, imagine a perfectly zeroed state. The code uses an additive prefix sum across memory, simultaneously creating sound. Each pass through the memory segment adds the current value of the accumulator to the memory cell, creating a running prefix sum.

Sound Interpretation

As the code modifies video memory, it also interprets it as audio data. The out 61h, al instruction sends the accumulator value to the speaker output port, thus turning memory changes into sound.

Conclusion

This project showcases the ingenuity and beauty of extreme constraint programming. With just 16 bytes, it transforms a visual animation into a fascinating soundscape. A true technical feat that illustrates how limitations can fuel creativity.

Let's discuss your project in 15 minutes.

x86 assembly demoscene algorithmic density Sierpinski fractal sound synthesis
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call