hn.today

Show HN: Conway's Game of Life in boot sector

github.com5 points1 comments
Screenshot of Show HN: Conway's Game of Life in boot sector

An x86 assembly implementation of Conway's Game of Life that fits into a single 512-byte boot sector and runs directly from boot, using VGA memory as the simulation grid. The code is written for NASM and designed to run in an emulator: it turns the VGA text/graphics framebuffer into the Life grid and updates cells in-place without an operating system. The project is an exercise in extreme code density and low-level hardware control, demonstrating how to initialize the machine state, draw to VGA memory, and iterate Life rules within the 512-byte constraint.

Included files show life.asm as the full boot-sector source, a Makefile, README, CONTRIBUTING.md and an ISC license. Build and run instructions are explicit: assemble with nasm -f bin -o life.img life.asm and boot in QEMU with qemu-system-i386 -drive file=life.img,format=raw,if=floppy, or use make run. The repository is intended for learning and amusement; it accepts bug reports and pull requests and documents dependencies (NASM and QEMU). The implementation highlights practical techniques for tiny-footprint assembly, VGA memory mapping, and boot-sector programming.

Read on github.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.