AttoChess, a complete, playable chess program for 16-bit x86 DOS in 278 bytes
4 hours ago
- #Optimization
- #Chess
- #Assembly
- AttoChess optimizes by rethinking board display, move decoding, and search loop, saving 10 bytes.
- Board display draws directly to console using int 29h, eliminating render buffer and DOS function 09h.
- Startup removes BIOS mode-set, using deterministic assumptions and cld for smaller code.
- Input decoder folds constants into base address, using 16-bit pointer math and imul for efficiency.
- Search loop frees CX by comparing pointers, avoiding depth reload from stack.
- Pawn direction is folded into color bit with xor, handling both colors in one path.