<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/attochess-a-278-byte-chess-program-for-16-bit-x86-dos-lucphkwlh" -->

---
title: AttoChess: a 278-byte chess program for 16-bit x86 DOS
description: AttoChess is a complete, playable chess program for 16-bit x86 DOS squeezed into just 278 bytes of machine code. The post details five key optimizations over a...
canonical: https://daily.dev/posts/attochess-a-278-byte-chess-program-for-16-bit-x86-dos-lucphkwlh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: AttoChess: a 278-byte chess program for 16-bit x86 DOS | daily.dev
og:description: AttoChess is a complete, playable chess program for 16-bit x86 DOS squeezed into just 278 bytes of machine code. The post details five key optimizations over a...
og:url: https://daily.dev/posts/attochess-a-278-byte-chess-program-for-16-bit-x86-dos-lucphkwlh
og:image: https://api.daily.dev/og/posts/lUcpHKWlh.png
og:image:alt: AttoChess: a 278-byte chess program for 16-bit x86 DOS
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AttoChess: a 278-byte chess program for 16-bit x86 DOS

**[Hacker News](https://daily.dev/sources/hn)** · 5 min read · 0 upvotes · 0 comments

## Summary

AttoChess is a complete, playable chess program for 16-bit x86 DOS squeezed into just 278 bytes of machine code. The post details five key optimizations over a prior implementation: eliminating the render buffer by encoding board borders as CR/LF bytes and streaming output via int 29h, dropping the BIOS mode-set in favor of explicit startup assumptions, folding ASCII bias constants into a pre-computed base address to simplify move input decoding, replacing a counted loop with a pointer comparison to keep the search depth in CX without stack reloads, and collapsing pawn direction logic into a single XOR against the color bit. Each optimization is explained with annotated x86 assembly snippets.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nicholas-afk.github.io/AttoChess>

## Similar posts on daily.dev

- [For Such A Small Program, ZX81 1K Chess Sure Packs A Lot In](https://daily.dev/posts/for-such-a-small-program-zx81-1k-chess-sure-packs-a-lot-in-1nixokoj7) · Hackaday · 0 upvotes · 0 comments
- [512-Byte Boot Sector Pong Game](https://daily.dev/posts/512-byte-boot-sector-pong-game-zngujdxvi) · Hacker News · 1 upvotes · 0 comments
- [wake up\! 16b](https://daily.dev/posts/wake-up-16b-mfatayrat) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#assembly](https://daily.dev/tags/assembly)

[View this post on daily.dev](https://daily.dev/posts/attochess-a-278-byte-chess-program-for-16-bit-x86-dos-lucphkwlh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"AttoChess: a 278-byte chess program for 16-bit x86 DOS","url":"https://daily.dev/posts/attochess-a-278-byte-chess-program-for-16-bit-x86-dos-lucphkwlh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/attochess-a-278-byte-chess-program-for-16-bit-x86-dos-lucphkwlh"},"datePublished":"2026-07-16T21:23:06.978Z","dateModified":"2026-07-16T21:23:28.537Z","description":"AttoChess is a complete, playable chess program for 16-bit x86 DOS squeezed into just 278 bytes of machine code. The post details five key optimizations over a...","image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","thumbnailUrl":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/attochess-a-278-byte-chess-program-for-16-bit-x86-dos-lucphkwlh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"assembly","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"AttoChess: a 278-byte chess program for 16-bit x86 DOS"}]}
```

