How graysonhuey/fasm-pong works
Project type and purpose
• This is a minimal single-binary game implemented entirely in x86_64 Assembly, using Raylib for graphics and input. It’s a “demo” or “toy” full-program rather than a multi-tier web app or service.
File structure
• Top-level files only:
• game.asm – the sole Assembly source
• Makefile – build instructions (invokes fasm, binutils)
• README.md – project description, dependencies
• LICENSE, .gitignore
• No separate “src” or “lib” folders; everything centers around game.asm and an external Raylib clone.
README for additional insights
• It requires: FASM assembler, GNU binutils (ld), Raylib (graphics/input library).
• Build steps: clone Raylib, then run make (Makefile wraps fasm + linking).
How to model this
a. Main components
1. game.asm source (your Assembly code)
2. FASM assembler (fasm) – compiles game.asm → object code
3. Linker (ld from binutils) – links object code + Raylib → executable
4. Raylib library (built from C sources) – provides graphics, input, audio API
5. OS Kernel & Drivers – Linux syscalls, GPU driver
6. Hardware (CPU, GPU, Keyboard/Mouse, Display)
b. Relationships & interactions
• At runtime: game.exe → calls Raylib API → Raylib uses OpenGL/Direct syscalls → OS Kernel → GPU, input devices
• User input (keyboard) → OS → Raylib → game logic
• Game draws frames → Raylib → GPU driver → screen
c. Architectural patterns/design principles
• Single-module “main loop” architecture: the Assembly code implements the game loop, delegates subsystems (rendering, input) to Raylib.
• External library integration: static or dynamic linking of Raylib.
d. Key technologies/frameworks/libraries
• FASM assembler, GNU ld (binutils)
• Raylib (C-based graphics/input)
• Linux x86_64 syscalls and GPU driver (OpenGL under the hood)
Detailed breakdown
• Build stage:
[game.asm] → (FASM) → [game.o]
[game.o] + [libraylib.a/.so] → (ld) → [game executable]
• Runtime stage:
[game executable] → game loop → calls → [Raylib API] → syscalls → [OS Kernel] → [GPU Driver/Display]
→ [Keyboard] → [Raylib input]
• External dependency: [Raylib Git clone] → build → [libraylib.a/.so]