If you want to donate with Paypal, my contact address is tuomoster AT gmail DOT com.

Amazon Wish List

file: vendu

projectszero, resurrection, wizard code

project: wizard code


Download Draft #4


Wizard Code on Hacker News

Wizard Code on Reddit

Note that I keep updating the book without necessarily changing the draft number so please re-download the file now and again if you are interested. :)

Help Needed

If you like the idea of Wizard Code, please read the whole book and send some feedback to tuomoster AT gmail DOT com. This way, the book could be a pleasure to both write and read. Thank you.


Chances are I might contact a publisher about the book later, chances are I might not, but get it while it's hot. If you enjoy this free read, please consider donating to the project with the Paypal button above. :)


Wizard Code is my take on machine programming. The book discusses the C language in depth from a low-level programmer's perspective. You will get familiar with how Unix-like systems execute code, how C code is translated to assembly (and later, trivially, to machine language), and such advanced topics.

The book assumes prior knowledge of the C language, so it's probably not the best pick for the first book on C. Try Kernighan and Ritchie's C Programming Language or another beginner- or intermediate-level text on C first. Take a look at the links section as well.


Cmachine-oriented discussion
useful new features in C99
computer representation of numeric values
segment-based permissions for code and data
stack-based run model
relation with and translation to assembly
code optimisation techniques
notes on code style
code examples including a world class malloc-allocator
Assemblyused where necessary
MMX examples of vector ('SIMD') programming


coverfirst idea for book front cover
coverfirst idea for book back cover


Magic Algorithmsa collection of tricks
bit twiddling hacksanother collection of tricks
HAKMEMlegendary MIT collection of tricks
the bit twiddlerStephan Brumme's collection of tricks

Suggested Reading

Rick BoothInner Loops
Dominic GiampaoloPractical File System Design with the Be File System
Randall HydeWrite Great Code Volume One - Understanding the Machine
Randall HydeArt of Assembly
Henry S. WarrenHacker's Delight