Tic-Tac-Toe in x86 Assembly

A tic-tac-toe game written in 16-bit x86 assembly for DOS, drawing its own board in VGA graphics mode.

  • x86 Assembly
  • NASM
  • DOS
  • VGA
github.com/viniciuscole/tic-tac-toe-assembly

Loads a DOS emulator, about 2.1 MB.

Commands

  • X11 — plays X on row 1, column 1
  • C22 — plays the circle on row 2, column 2
  • c — starts a new game
  • s — quits and restores the video mode

Emulated with js-dos and DOSBox, both GPL-2.0. licence textjs-dos, emulators

The whole game is written in NASM 16-bit real mode assembly, targeting DOS. It switches the display into VGA mode 12h (640x480, 16 colours) through int 10h and draws every line and circle itself: draw.asm implements Bresenham’s line and circle algorithms plus pixel plotting, and vca.asm holds the game logic, the command parser and win detection.

Moves are typed as commands. X11 plays X on row 1, column 1; c starts a new game; s quits and restores the previous video mode.