Assembly Language Codex
Low-level programming patterns for x86-64 Linux systems.
Topics
| Topic | Description |
|---|---|
Registers, memory, addressing modes, basic instructions |
|
Math operations, bitwise, comparisons, flags |
|
Call conventions, stack frames, local variables |
|
System call interface, common syscalls, error handling |
|
Disassembly patterns, common constructs, analysis |
Why Assembly?
| Use Case | Value |
|---|---|
Kernel Development |
Understanding kernel code, writing optimized paths |
Security Research |
Exploit development, malware analysis, CTF challenges |
Performance |
Identifying bottlenecks, understanding compiler output |
Debugging |
Reading crash dumps, understanding segfaults |
Tools
| Tool | Purpose |
|---|---|
|
Disassemble binaries |
|
Debug at instruction level |
|
Trace syscalls |
|
Trace library calls |
|
Netwide Assembler |
|
Generate assembly from C |
Quick Reference
Registers (x86-64)
RAX, RBX, RCX, RDX - General purpose (64-bit)
RSI, RDI - Source/Destination index
RSP, RBP - Stack/Base pointer
R8-R15 - Additional general purpose
RIP - Instruction pointer
RFLAGS - Status flags
Calling Convention (System V AMD64)
Arguments: RDI, RSI, RDX, RCX, R8, R9 (then stack)
Return: RAX (and RDX for 128-bit)
Callee-saved: RBX, RBP, R12-R15
Caller-saved: RAX, RCX, RDX, RSI, RDI, R8-R11
Related Resources
-
Kernel Development - Practical application
-
Process Management - User-space perspective