Carthigan Education · Free Book

The
No-Nonsense
Guide to Assembly

From CPU anatomy to a 512-byte bootable operating system. Every program runs, every chapter has answers, and the whole thing is free.

377
pages
30
chapters
55+
diagrams
$0
forever
The cover of The No-Nonsense Guide to Assembly: dark charcoal background, Carthigan wordmark, title in cream and orange

No email. No paywall. Just the book.

What You'll Build

Six programs, zero libraries.

01

An Interactive Calculator

Reads two integers and an operator, prints the answer. No C library, just syscalls and the digit tricks that make numbers printable.

02

A Professional Hex Dumper

A working clone of xxd: 16 bytes per line, offsets, and an ASCII sidebar. Then it inspects its own binary and finds the ELF magic.

03

A Unix Shell

fork, execve, wait. The three syscalls behind every shell on your machine, in a working prompt-to-prompt loop.

04

A Web Server

Serves a live HTML page with a visitor counter over HTTP, written entirely in assembly. Verified with a real curl session.

05

A Custom malloc

Your own memory allocator with block headers, splitting, and free-list reuse. The layer underneath every malloc you've ever called.

06

A Bootable Operating System

The final chapter. A 512-byte boot sector that paints the screen and reads your keystrokes with no operating system underneath at all.

Inside the Book

55+ original diagrams. Every program verified.

The programs in this book were assembled and run on real Linux. The debugger sessions, HTTP exchanges, and the boot screenshot are real captures, not mockups.

Table of Contents

6 parts. 30 chapters.

I

The Machine

  • 1 The Anatomy of a Computer
  • 2 Inside the x86-64 CPU
  • 3 The Workshop: NASM, ld, and Your First Program
  • 4 Moving Data and Addressing Memory
  • 5 Arithmetic, Logic, and the Division Trap
II

Control Flow, the Stack, and Functions

  • 6 Branching: cmp, Flags, and Jumps
  • 7 The Hardware Stack
  • 8 Functions and the System V ABI
  • 9 Strings, Arrays, and the String Engine
  • 10 Capstone: An Interactive Calculator
III

Talking to the Operating System

  • 11 Command-Line Arguments
  • 12 Files and File Descriptors
  • 13 Dynamic Memory: Asking the Kernel for RAM
  • 14 Structs and Linked Lists
  • 15 Mixing Assembly and C
  • 16 NASM Macros and Project Organization
IV

Performance

  • 17 Floating-Point and SIMD
  • 18 Branchless Programming and Cycle Counting
  • 19 Concurrency and Atomic Operations
  • 20 Inline Assembly in C and Rust
V

Under the Surface

  • 21 How the CPU Reads Your Code: Instruction Encoding
  • 22 Debugging and Reverse Engineering with GDB
  • 23 Stack Smashing and Its Defenses
  • 24 Position-Independent Code and Shared Libraries
  • 25 Raw Terminal Mode
VI

Real Software, from Scratch

  • 26 A Professional Hex Dumper
  • 27 A Unix Shell
  • 28 Sockets and a Web Server
  • 29 A Custom malloc and free
  • 30 Booting Into the Void

About the Author

Eden Gilbert Kiseka is a software and electronics engineer in Kampala, Uganda, and the founder of Carthigan. He taught embedded systems programming at Neriko Electronics, where he built the curriculum and the hands-on labs from scratch.

He wrote this book to be the course he wished his students had: no magic, no hand-waving, every layer explained down to the bytes.

Fire the translator.

Read it online, print it, share it, remix it. The text is CC BY 4.0 and the code is MIT. Errata go straight to GitHub.

377 pages · 30 chapters · every program verified · free, forever