Back Original

I wrote a Pong game in a 512-byte boot sector

written by - Akshat Joshi

Sometime back, I set myself a crazy constraint:

Why would I build this?

I have played with Operating Systems and their workings by customizing them and tweaking their behavior. But this was about pushing constraints to the extreme. Can I have an OS which just loads one PONG GAME ?

The challenge

The boot sector is the first 512 bytes a computer loads from disk. It has to end with the magic bytes 0x55 0xAA β€” leaving only 510 bytes for actual code.

After learning about Operating systems and the bootup flow, I finally managed to get a pong game running πŸ˜„

How it works!

The game runs in 80x25 text mode (VGA mode 03h) using BIOS interrupt 10h.

Controls

W / S β€” Move your paddle

It’s a deterministic ball-tracking logic. It checks the ball’s Y position every frame:

Simple. Fast. Fits in 510 bytes.

0:00

/0:20

Demo run

Key Technical Highlights

The Full Code

The entire game is in one file: pong.asm

Run It Yourself

  1. Clone the repo
  2. Assemble with NASM
  3. Run in QEMU (or burn to USB and boot on old hardware)