An electrifying retro DOS game built entirely from scratch in x86 16-bit Assembly
🎮 Features • 🎨 Game Visuals • ⚙️ Installation • 🎯 How to Play • 🏗️ Architecture • 🛠️ Technical Dev Tools
Balloon Pop is a feature-complete DOS game crafted from the ground up in pure x86 Assembly—no high-level languages, no shortcuts. Every pixel, every sound, every game mechanic was hand-coded in assembly to deliver a smooth, flicker-free gaming experience.
This project is more than a game; it's a testament to low-level programming mastery, demonstrating how to build complex, responsive applications when working directly with hardware. All compressed into just 15KB of compiled code.
- VGA Mode 13h (320×200, 256 colors) – Classic DOS-era graphics with direct video memory access
- Custom Color Palette – Hand-crafted retro aesthetic
- Double-Buffered Rendering – Draw to buffer first, then flush to video memory = zero flicker, buttery-smooth gameplay
- Four Balloon Variants – Blue, Yellow, Green, Pink (created in GIMP)
- Smooth Floating Animations – Balloons drift naturally up the screen
- CGA Font System – Authentic retro text rendering
- Main Menu – Clean navigation interface with guided controls
- Options Screen – Customize difficulty and audio
- Difficulty Levels – Easy (🟢), Medium (🟡), Hard (🔴)
- Dynamic Scoring System – Real-time score tracking
- 120-Second Timer – 2 minutes to pop as many balloons as possible
- Pause Functionality – Press
SPACEto pause (no blinking overlay) - High Score System – Save scores with custom player names
- Scores Display – View all-time high scores leaderboard
- Clear Scores – Reset leaderboard from scores page
- Music Toggle – Enable/disable background music
- Sound Effects – PC speaker audio feedback (pop sounds)
- Smooth Game Over Screen – Animated end sequence with floating final score
- On-Screen Guidance – All controls displayed for easy reference
- Background Music – Retro chiptune-style track (toggleable)
- Sound Effects – Balloon pop, menu clicks, scoring audio
- PC Speaker – Authentic DOS-era audio synthesis
P → Play Game
O → Options
E → Exit
[Any Key] → Continue prompts
E → Easy Difficulty
M → Medium Difficulty
H → Hard Difficulty
T → Toggle Music On/Off
B → Back to Main Menu
D → Delete All Scores
B → Back to Options
M → Return to Main Menu
[Letter Keys] → Pop balloons (A-Z)
[SPACE] → Pause Game
Experience the retro DOS aesthetic across seven unique screens:
Animated introduction with floating "TYPE POP" balloons
Main navigation hub with Play, Options, and Exit options
Customize difficulty level (Easy/Medium/Hard) and toggle music
View high scores leaderboard and clear scores if desired
Main gameplay with timer, score display, and floating balloons
Displays Paused message while the game waits for the user to resume
Game over sequence with final score animation
Player name entry and score persistence confirmation
Critical: Set CPU cycles to 47810 for optimal gameplay speed!
Edit your dosbox.conf:
[cpu]
core=auto
cputype=auto
cycles=47810
cycleup=10
cycledown=20# 1. Clone/Download the repository
cd /path/to/Coal-Proj
# 2. Compile with NASM
nasm -f bin main.asm -o game.com
# 3. Run in DOSBox (with correct CPU cycles)
dosbox game.com✨ That's it! One compile command handles everything via our macro system.
START → Press any key to begin
↓
MENU → Navigate: P (Play) | O (Options) | E (Exit)
↓
GAMEPLAY → 2-minute timer to pop balloons!
├─ Press letter keys to pop balloons
├─ Each pop = +10 points
└─ Press SPACE to pause
↓
GAME OVER → Enter your name to save score
↓
VIEW SCORES → Check leaderboard
Pro Tips:
- 🎯 Higher difficulty = more points per balloon
- 🎵 Toggle music in options for focus mode
- 📊 Beat your high scores
- 💾 Scores persist across sessions
Coal-Proj/
├── main.asm # Entry point & core initialization
├── assets/ # Game resources
│ ├── blue.raw # Balloon sprites (GIMP-created)
│ ├── green.raw
│ ├── pink.raw
│ ├── yellow.raw
│ ├── CGA.F08 # CGA font data (8×8 pixels/char)
│ ├── palette.pal # Custom VGA palette
│ └── assets_offsets.inc # Sprite offset constants
│
├── libraries/ # Reusable macro & function libraries
│ ├── macros.asm # Core utility macros
│ ├── disp/ # Display & graphics functions
│ │ ├── abstractions/
│ │ │ └── load_pal.asm
│ │ ├── txt/
│ │ │ ├── disp_str_at.asm
│ │ │ ├── disp_int_at.asm
│ │ │ ├── disp_00_int_at.asm
│ │ │ └── disp_str_with_delay.asm
│ │ ├── display_score.asm
│ │ ├── display_timer.asm
│ │ ├── draw_bal.asm
│ │ ├── float_balloon.asm
│ │ └── draw_buffer_to_video.asm
│ ├── cal/
│ │ └── cal_pos.asm
│ └── misc/
│ ├── chaining.asm
│ ├── random.asm
│ ├── file_handling.asm
│ ├── load_data.asm
│ ├── save_score_with_name.asm
│ └── delay.asm
│
└── screens/ # Game screens
├── menu.asm
├── options.asm
├── scores_screen.asm
├── start_screen.asm
├── pause_screen.asm
├── end_screen.asm
└── game/
├── game_screen.asm
└── keyboard_hook.asm
We designed reusable, configurable macros that can be leveraged across projects:
CHAIN_INT 0x9, kbisr, org_kb_isr
; Chains keyboard ISR without losing original handler
; Configurable for any interrupt vector
; Reusable in other projects requiring ISR stackingLOAD_SEGMENT ds, 0xA000
; Clean, readable segment initialization
; Used throughout graphics codeFLOAT_BALLOON balloon_y_pos, screen_x
; Smooth floating with collision detection
; Configurable speed and direction
; Portable to other animation needsIF_EQ ax, bx, .label
; Cleaner syntax: "if equal, jump to label"
; Replaces verbose cmp/je patterns
; Makes assembly code more readableThese macros are production-ready and can be extracted for use in other projects!
The key to our flicker-free gameplay:
┌─────────────────────────────────────┐
│ Game Logic Updates │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Draw Everything to RAM Buffer │
│ (Fast: no video memory contention) │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ Flush Complete Buffer to Video │
│ (Atomic operation: no flickering) │
└─────────────────────────────────────┘
Result: Smooth 60+ FPS gameplay without a single flicker!
- Direct Video Memory Access –
0xA000:0000manipulation - BIOS Interrupts – VGA mode setup, palette loading
- DOS Interrupts – File I/O for score persistence
- Hardware Keyboard ISR – Real-time input handling
- PC Speaker – PWM audio synthesis for sound effects
Scores are saved to scores.txt with:
- Player Name – Custom player identification
- Score Value – 16-bit unsigned integer
- File Format – Line-delimited text for easy viewing
Ahmad : 2450
Asjad : 1890
TestPlayer : 750
| Metric | Value |
|---|---|
| Compiled Size | 15KB |
| Draw Time | <16ms (60+ FPS) |
| Input Latency | <1ms |
| Memory Usage | ~64KB conventional |
| Flicker Rate | 0% (double-buffered) |
| CPU Requirement | 47810 cycles (DOSBox) |
- Tool: GIMP (GNU Image Manipulation Program)
- Format: 17×36 pixel sprites in RAW binary
- Colors: Palette-mapped (4 unique balloon colors)
- Optimization: Compact binary format for fast rendering
- Format: CGA 8×8 character bitmaps
- Coverage: 256 ASCII characters
- Performance: Direct lookup via character code
- Colors: 256-color VGA palette
- Design: Retro-authentic DOS aesthetic
- Optimization: Grouped by hue for coherent visuals
This project demonstrates:
- ✅ x86 Real-Mode Programming – 16-bit assembly mastery
- ✅ VGA Graphics Programming – Mode 13h deep dive
- ✅ DOS & BIOS Interrupts – System-level integration
- ✅ ISR Implementation – Keyboard handling via INT 0x9
- ✅ File I/O – DOS interrupt-based disk access
- ✅ Memory Management – Segment/offset addressing
- ✅ Macro Systems – Abstraction without overhead
- ✅ Animation & Timing – Frame-based rendering
- ✅ Code Optimization – 15KB feature-complete game
Building Balloon Pop from scratch in pure assembly was an enlightening journey:
- Zero abstractions forced us to understand every operation
- Memory efficiency became second nature (15KB for a complete game!)
- Algorithm optimization proved essential when every byte counts
- Interrupt-driven design revealed the power of responsive systems
- VGA programming at the register level
- Memory segmentation and real-mode addressing
- Interrupt vectors and ISR chaining techniques
- Direct hardware control without OS abstraction
- Double-buffering eliminates flicker elegantly
- Frame-based animations create smooth movement
- Responsive input handling via ISRs
- Score persistence through DOS file operations
"Assembly programming teaches you respect for efficiency. When your entire game fits in 15KB, you learn to make every instruction count. This isn't a limitation—it's liberation. Without the bloat of high-level abstractions, we built something fast, responsive, and deeply satisfying."
Why This Matters:
- Modern developers rarely see the actual hardware
- Assembly reveals the reality of how computers work
- Optimizations learned here apply to all languages
- Performance consciousness becomes instinctive
- Multiplayer mode (turn-based scoring)
- Difficulty progression (escalating balloon speed)
- Power-ups (time extension, score multiplier)
- Animated transitions between screens
- Configuration file for settings persistence
- Extended sound track with multiple themes
This is a complete, finished project—but we welcome:
- Bug reports and optimizations
- Assembly technique suggestions
- Asset improvements (GIMP sources)
- Documentation enhancements
This project is open source under the MIT License.
Ahmad Rehan • Syed Asjad Raza
Built with ❤️ in pure x86 Assembly
An enjoyable journey of discovery, teaching us to build robust, efficient logic from the ground up.







