A retro Brick Breaker (Breakout) arcade game and Dual-Pane Serial Chat client written entirely in 16-bit x86 Assembly for MS-DOS.
The project combines low-level game development with direct hardware programming: VGA graphics through BIOS services, keyboard polling, and direct UART communication through the 8250/16550-compatible COM1 serial port.
The multiplayer mode runs across two connected DOSBox instances. The Host controls the main game state and ball physics, while the Joined player controls the second paddle.
Classic Brick Breaker gameplay with colored brick rows, ball physics, paddle control, score tracking, and lives.
-
Single-Player Brick Breaker
- 40 color-coded bricks arranged in a 4 × 10 grid.
- Paddle movement using the keyboard.
- Ball collision and directional deflection.
- Score tracking.
- Three-life game loop.
- Brick destruction state tracking.
-
Real-Time Serial Multiplayer
- Peer-to-peer communication over COM1.
- DOSBox null-modem networking support.
- Host-authoritative ball physics.
- Remote paddle synchronization.
- Compact command/state protocol.
- Handshake and win/loss confirmation.
-
Dual-Pane Serial Chat
- 80 × 25 text-mode terminal.
- Separate local and remote display panes.
- Real-time serial communication.
- Independent line scrolling.
- BIOS keyboard and video services.
-
Direct Hardware / BIOS Programming
- VGA Mode 13h graphics.
- Direct UART register access.
- Non-blocking keyboard polling.
- DOS and BIOS interrupt services.
- Designed for 8086/8088 real-mode environments.
The main menu provides three modes:
| Key | Mode | Description |
|---|---|---|
S |
Single Player | Play the classic Brick Breaker game. |
M |
Multiplayer | Connect two DOSBox instances through COM1. |
C |
Serial Chat | Use COM1 as a split-screen terminal. |
Esc |
Exit | Return to DOS. |
| Key | Action |
|---|---|
A |
Move paddle left |
D |
Move paddle right |
Space |
Launch / release the ball |
Esc |
Return to the main menu |
The game contains 40 bricks arranged in four rows and ten columns.
+-------------------------------------------------------+
| [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] |
| [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] |
| [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] |
| [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] |
+-------------------------------------------------------+
The horizontal velocity of the ball depends on where it hits the paddle:
- Center hit:
Vx = 0 - Left-side hit:
Vx = -1 - Right-side hit:
Vx = 1
A paddle collision reverses the vertical velocity:
Vy = -Vy
This produces different reflection angles depending on the collision position.
A 40-byte boolean array, IsDestroied, tracks the state of every brick.
0 → Brick is active
1 → Brick is destroyed
When the ball hits a brick:
- The brick is marked as destroyed.
- The vertical ball velocity is inverted.
- The score is updated.
- The destroyed brick index can be sent to the remote player.
- An audible beep is generated.
The multiplayer implementation uses a Host / Joined Player architecture.
The Host is responsible for the authoritative game state:
- Calculates ball movement.
- Detects ball collisions.
- Handles brick destruction.
- Updates the score.
- Sends game-state updates to the Joined player.
- Processes remote paddle commands.
The Joined player:
- Connects to the Host through COM1.
- Sends paddle movement commands.
- Receives ball and game-state updates.
- Renders the synchronized game state.
This approach keeps ball physics centralized on the Host instead of allowing both machines to independently simulate the ball.
The multiplayer protocol uses compact byte-oriented commands.
| Value / Bitfield | Meaning |
|---|---|
0x01 |
Host handshake / Win confirmation |
0x02 |
Client acknowledgement / Loss confirmation |
0x03 |
Remote score increment |
11111110b |
Joined paddle: Left |
11111111b |
Joined paddle: Right |
1110xxxxb |
Host update: stationary paddle + ball (Vx, Vy) |
111100xxb |
Host update: paddle moving left + ball (Vx, Vy) |
111101xxb / 111111xxb |
Host update: paddle moving right + ball (Vx, Vy) |
AH |
Destroyed brick index payload |
The protocol is intentionally compact because the target environment is a 16-bit real-mode system communicating over a low-bandwidth serial link.
The project directly programs the COM1 UART through I/O ports.
0x3F8
Port 0x3FB (LCR) <- 10000000b ; Enable DLAB
Port 0x3F8 (DLL) <- 0x0C ; Baud divisor low byte
Port 0x3F9 (DLM) <- 0x00 ; Baud divisor high byte
Port 0x3FB (LCR) <- 00011011b ; 8 data bits, 1 stop, even parity| Parameter | Value |
|---|---|
| Port | COM1 |
| Base Address | 0x3F8 |
| Baud Rate | 9600 |
| Data Bits | 8 |
| Stop Bits | 1 |
| Parity | Even |
| UART | 8250 / 16550 compatible |
The game uses VGA Mode 13h:
Resolution: 320 × 200
Colors: 256
Video operations are performed through BIOS INT 10h.
Keyboard input uses BIOS INT 16h.
The game uses non-blocking keyboard polling so that input can be checked while the game loop continues running.
UART communication is performed using x86 IN and OUT instructions rather than a high-level operating-system serial API.
Important COM1 registers include:
0x3F8 Data Register
0x3F9 Interrupt Enable Register
0x3FA Interrupt Identification / FIFO Control
0x3FB Line Control Register
0x3FC Modem Control Register
0x3FD Line Status Register
| Interrupt | Function |
|---|---|
INT 10h |
Video services |
INT 10h / AH=00h |
Set video mode |
INT 10h / AH=0Ch |
Plot pixel |
INT 10h / AH=02h |
Set cursor position |
INT 10h / AH=06h |
Scroll text window |
INT 16h / AH=01h |
Check keyboard status |
INT 16h / AH=00h |
Read keyboard input |
INT 21h / AH=09h |
Print string |
INT 21h / AH=02h |
Print character |
INT 21h / AH=4Ch |
Terminate program |
The project also includes a split-screen serial terminal.
+------------------------------------------------+
| LOCAL / SENT DATA |
| |
| > Hello from Host |
| > Ready? |
| |
|------------------------------------------------|
| REMOTE / RECEIVED DATA |
| |
| < Hello from Client |
| < Yes! |
| |
+------------------------------------------------+
The terminal uses text mode 03h with an 80 × 25 character display.
Local and remote messages are displayed in separate regions, and each pane can scroll independently.
+----------------------+
| Main Menu |
+----------+-----------+
|
+----------------+----------------+
| | |
v v v
+-------------+ +-------------+ +-------------+
| Single | | Multiplayer | | Serial Chat |
| Player | | Mode | | Mode |
+------+------+ +------+------+ +------+------+
| | |
| COM1 / UART |
| | |
v v v
+------------------------------------------------+
| BIOS / DOS Services |
| INT 10h | INT 16h | INT 21h |
+------------------------------------------------+
|
v
+----------------------+
| PC Hardware / VGA / |
| UART / Keyboard |
+----------------------+
- CPU: Intel 8086 / 8088 / 80286+
- Architecture: x86
- Execution Mode: 16-bit Real Mode
- Operating System: MS-DOS
- Memory Model:
.MODEL SMALL - Code Segment: 64 KB
- Data Segment: 64 KB
- Stack: 64 bytes
- Graphics: VGA Mode 13h
- Serial Port: COM1
- Assembler: TASM or MASM 6.11
- DOSBox, DOSBox-X, or DOSBox-Staging
- Borland Turbo Assembler (TASM) and Turbo Linker (TLINK)
- Or Microsoft Macro Assembler (MASM 6.11)
Place game.asm in your DOS working directory:
tasm /zi game.asm
tlink /v game.obj
game.exe
Two DOSBox instances can be connected locally through a virtual null-modem TCP connection.
Configure COM1 as the server:
[serial]
serial1=nullmodem port:5000 server:1Configure COM1 as the client:
[serial]
serial1=nullmodem port:5000 server:0- Start DOSBox Instance 1.
- Run
game.exe. - Select
Mfor Multiplayer. - Start DOSBox Instance 2.
- Run
game.exe. - Select
Mon the second instance. - The two instances establish communication through the virtual COM1 connection.
The same configuration can be used to test the split-screen serial chat by selecting C.
This project demonstrates practical low-level programming concepts including:
- 8086 Assembly
- x86 Real Mode
- BIOS interrupts
- DOS interrupts
- VGA Mode 13h
- Pixel-level graphics
- Game loops
- Collision detection
- Basic game physics
- Keyboard polling
- UART programming
- Direct hardware I/O
- Serial communication
- Null-modem communication
- Multiplayer synchronization
- State serialization
- Memory management in a 16-bit environment
The project is designed to demonstrate how a complete interactive application can be implemented close to the hardware level, without relying on modern operating-system graphics or networking APIs.
It combines:
Game Development + Assembly + VGA Graphics + Hardware I/O + Serial Communication + Multiplayer Synchronization
into a single 16-bit DOS application.
This project is intended for educational and experimental purposes.

