HeadlinesBriefing favicon HeadlinesBriefing.com

Atto Chess: 278-byte DOS chess program

Hacker News •
×

Atto Chess is a complete, playable chess program for 16-bit x86 DOS that astonishingly fits within 278 bytes. This minuscule program draws the board, accepts keyboard input for moves, searches four plies deep, and provides a reply. It successfully beats the previous record holder, Lean Chess, by 10 bytes.

Developed by Nicholas Tanner in 2026, Atto Chess is a size-optimized descendant of Lean Chess, retaining its 0x88-style board and recursive minimax search. The author emphasizes that this is not merely a setup program; it boots, displays the position, reads moves, searches, and replies with a legal move, looping for continuous play. The 278-byte figure represents the fully assembled size of the executable .COM file.

The optimizations employed to achieve this record size include a novel board drawing method that streams characters directly to the console using fast I/O, eliminating the need for a render buffer. It also simplifies the startup routine by omitting BIOS mode-setting and streamlines move decoding by pre-folding ASCII constants into a base address. Furthermore, a minor adjustment within the search loop frees up a register, allowing for a more efficient depth counter, and pawn movement logic is ingeniously folded into the color bit.

Atto Chess builds upon prior work, specifically citing Dmitry Shechtman's Lean Chess (288 bytes, 2019), Olivier Poudade's Boot Chess (487 bytes, 2015), and David Horne's 1K ZX Chess (672 bytes, 1982), honoring their contributions to the field of compact chess programs. The source code is available on GitHub under the MIT license.