Overview
As projects grow, proper organization becomes critical. This guide covers:- Directory structure conventions
- Multiple ASM file management
- Include directives and dependencies
- Build optimization
- Version control practices
Project Structure Examples
Small Project (Single ASM File)
Medium Project (Multiple ASM Files)
Large Project (8BP with Modules)
Include Directives (ABASM)
READ Directive
Include assembly source files:INCBIN Directive
Include binary data:Relative Paths
Module Organization
Code Modules
Separate by functionality:player.asm
enemies.asm
Data Modules
Separate data from code:level1_data.asm
Dependency Management
Include Order
Careful ordering prevents undefined symbols:Shared Constants
Define once, use everywhere:constants.asm
Public/Private Symbols
Use naming convention:Build Optimization
Conditional Assembly
Compile different versions:Module Toggling
Optimize Includes
Only include what you need:Version Control (.gitignore)
Recommended .gitignore
Documentation Practices
Module Headers
Function Documentation
README.md Template
Running
Project Structure
src/asm/- Assembly source codesrc/basic/- BASIC loaderssrc/music/- Music and sound effectsassets/- Graphics (PNG files)docs/- Documentation
Controls
- Arrow keys: Move
- Space: Jump/Fire
- M: Toggle music
Credits
- Programming: Your Name
- Graphics: Artist Name
- Music: Composer Name
- Made with DevCPC: https://github.com/destroyer-dcf/DevCPC
Integration Tests
Test module interactions:Performance Profiling
Timing Critical Sections
Frame Time Budget
Common Patterns
Initialization Sequence
State Machine
Tools and Scripts
Level Editor (Python)
Build Script
Troubleshooting
”Symbol not defined”
Problem: Using symbol before it’s defined Solution: Check include order, define constants first”Include file not found”
Problem: Wrong relative path Solution: Use paths relative to current file:“Out of memory”
Problem: Project too large Solutions:- Remove unused code
- Optimize data structures
- Use compression
- Split into multiple binaries
Best Practices Summary
- Organize by function, not by file type
- One concept per file (player, enemies, etc.)
- Include order matters (dependencies first)
- Document public interfaces
- Use meaningful names (player.asm, not module1.asm)
- Test individual modules before integration
- Version control everything except generated files
- Keep data separate from code
- Use constants instead of magic numbers
- Profile early to avoid surprises
Related
- 8BP Game Example - Large organized project
- ASM Project Example - Clean ASM structure
- Music & Sound - Organizing music files
- Sprite Animation - Managing sprite assets