A curated collection of x64 assembly language learning notes and practical examples written in NASM for Linux. This repository serves as a personal reference for low-level systems programming concepts, covering fundamental architecture, registers, instructions, syscalls, and building small assembly programs.
This collection was built to solidify understanding of how software interacts with hardware at the lowest level. It is useful for:
- Learning x64 assembly for systems programming and performance-critical code
- Understanding how higher-level languages compile to machine instructions
- Debugging and reverse engineering fundamentals (reading disassembly, understanding calling conventions)
- Building a foundation for security-aware engineering (binary analysis, memory safety concepts)
| Directory | Description |
|---|---|
Understanding_Cpu_Registers |
Notes on general-purpose registers, segment registers, flags, and how the CPU manages state |
Assembly_Instructions |
Reference for common x64 instructions — data movement, arithmetic, logic, and control flow |
Basic_Maths |
Simple arithmetic operations implemented in assembly |
System_Calls |
Examples of Linux syscalls (read, write, exit) invoked from user-space assembly |
User_Input |
Programs demonstrating keyboard input handling via syscalls |
Hello_World |
Minimal examples for printing output to the terminal |
- Linux (tested on common distributions)
- NASM assembler (
sudo apt install nasm) - GNU linker (
sudo apt install binutils)
# Assemble
nasm -f elf64 filename.asm -o filename.o
# Link
ld filename.o -o filename
# Run
./filename- Registers: RAX, RBX, RCX, RDX, RSI, RDI, RSP, RBP, RIP — their roles and conventions
- Calling Conventions: System V AMD64 ABI (Linux) — how arguments are passed and return values handled
- Memory Layout: Stack, heap, data segment, and how the OS manages process memory
- Syscalls: Interfacing with the Linux kernel via the syscall instruction
- Debugging: Using GDB to step through assembly, inspect registers, and analyze memory
Assembly is not about writing production code in it — it is about understanding what your CPU is actually doing. This knowledge is invaluable for:
- Writing performant code and understanding compiler optimizations
- Debugging crashes and memory corruption issues
- Security work: reverse engineering, binary analysis, and understanding exploit mechanics
- Systems and kernel programming where direct hardware control is required
- NASM Manual
- System V AMD64 ABI
- Linux Syscall Reference
- Intel® 64 and IA-32 Architectures Software Developer Manuals
This repository is a learning resource. The code examples are minimal and intended for educational purposes.