A comprehensive collection of FASM (Flat Assembler) examples, utilities, and learning resources for x86_64 assembly programming on Linux.
.
├── Core Files
│ ├── common.inc # Core macros and utilities
│ ├── linux.inc # Linux syscall definitions
│ └── debug.inc # Debug helpers and macros
│
├── Basic Examples
│ ├── mycat.asm # File reading example
│ ├── arg.asm # Command line args
│ ├── fib.asm # Fibonacci sequence
│ ├── two_sum.asm # Two sum algorithm
│ └── file_ops.asm # File operations
│
├── Advanced Examples
│ ├── add/ # Addition operations
│ │ ├── add.asm
│ │ ├── add.py # Python wrapper
│ │ ├── readme.md
│ │ └── wrapper.c # C wrapper
│ │
│ ├── binary_search/ # Binary search implementation
│ │ ├── bin_s.asm
│ │ ├── bin_s.py
│ │ ├── readme.md
│ │ └── wrapper/ # Wrapper implementations
│ │
│ ├── cadd/ # C-integrated addition
│ │ ├── add.c
│ │ ├── add.py
│ │ └── run.sh
│ │
│ ├── coroutines/ # Coroutine examples
│ │ ├── build.sh
│ │ ├── coroutine.py
│ │ ├── readme.md
│ │ ├── switch.asm
│ │ └── wrapper.c
│ │
│ └── vec/ # Vector operations
│ ├── dot_product.asm
│ ├── readme.md
│ ├── vec.py
│ └── wrapper.c
│
├── Documentation
│ ├── AI_FASM_RULES.md # AI coding guidelines
│ └── FASM_REFERENCE_GUIDE.md # FASM reference
│
└── Test Files
├── test.txt # Test data
├── lol.txt # Additional test data
└── output.txt # Output example
- Common Include Files: Reusable macros and utilities for FASM programming
- Example Programs: From basic to advanced assembly concepts
- System Programming: File operations, process management, and more
- Algorithm Implementations: Common algorithms in assembly
- Language Integration: Python and C wrappers for assembly code
- Documentation: Comprehensive guides and references
-
Install FASM:
# Ubuntu/Debian sudo apt-get install fasm # Arch Linux sudo pacman -S fasm
-
Build a basic example:
# File reading example fasm mycat.asm chmod +x mycat ./mycat # Or try fibonacci calculator fasm fib.asm chmod +x fib ./fib
- AI FASM Rules - Guidelines for AI-assisted FASM programming
- FASM Reference Guide - Comprehensive FASM reference guide
mycat.asm
- File reading and writingarg.asm
- Command line argument handlingfib.asm
- Fibonacci sequence calculatortwo_sum.asm
- Two sum algorithm implementationfile_ops.asm
- Advanced file operations
Each advanced example includes its own README with build and usage instructions:
- Addition Operations - FASM with Python/C integration
- Binary Search - Search implementation with wrappers
- Coroutines - Assembly coroutines with Python
- Vector Operations - SIMD/Vector processing examples
- File operations (open, read, write, close)
- Command line argument handling
- System calls with error checking
- Python wrappers
- C integration
- Build scripts
- Two Sum problem
- Binary Search
- Vector operations
- Fibonacci sequence
- SIMD operations
- Coroutines
- Cross-language integration
gdb Frontend - https://github.com/nakst/gf
int3 - in code to set breakpoint
readelf -h BINARY // start point
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.