X-87 is a 256-byte DOS graphics program for 386-or-newer PCs, created for Outline 2026. It uses x86 and x87 floating-point instructions in real mode to generate a 640-by-400, 32-bit-color landscape: oscillating calculations place pixels into a barren scene with a dark sky, ground, and an incidental moon-like shape. Color is built up through brightness-dependent increments, giving the image a dithered appearance. The result grew from p5.js experiments begun in 2021; after the idea was reshaped into a landscape, its composition emerged largely through iterative adjustments to oscillators and scaling.
The creator describes compressing the design into the strict 256-byte limit over two weeks. A Forth prototype helped translate the drawing logic into x87, followed by a grayscale DOS version and rounds of optimization to make room for color. Further savings came from overlapping data, packing color increments, reducing floating-point operations, and combining loops. Compatibility work addressed uninitialized state, VESA memory banking, and visual artifacts that appeared especially strongly in Bochs; the final version was tested with Bochs and FreeDOS, though not on physical hardware. Rendering is slow - about 13 minutes in DOSBox at default settings, or roughly two minutes at higher cycle counts. The author considers the result close to the prototype but questions whether 32-bit color is necessary, and notes that resolution changes affect brightness, density, and artifact visibility.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.