Skip to content

rootkit-io/x64_assembly

Repository files navigation

x64 Assembly

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.

Purpose

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)

Repository Structure

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

Getting Started

Prerequisites

  • Linux (tested on common distributions)
  • NASM assembler (sudo apt install nasm)
  • GNU linker (sudo apt install binutils)

Build and Run

# Assemble
nasm -f elf64 filename.asm -o filename.o

# Link
ld filename.o -o filename

# Run
./filename

Key Concepts Covered

  • 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

Why Learn Assembly?

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

Resources


This repository is a learning resource. The code examples are minimal and intended for educational purposes.

About

x64 assembly learning notes and practical examples — registers, instructions, syscalls, and low-level systems programming on Linux.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors