Programming Books

7 Excellent Free Books to Learn X86 Assembly

Last Updated on May 22, 2022

An assembly language is a low-level programming language for a computer, or other programmable device. Assembly language is used by almost all modern desktop and laptop computers. It is as close to writing machine code without writing in pure hexadecimal. It is converted into executable machine code by a utility program referred to as an assembler.

Assembly language is infrequently used by programmers nowadays, but there are still good reasons to learn the language. It is the most powerful computer programming language available. While assembly language shares very little with high level languages (such as Java, C#, Python etc), and assembly languages for different CPU architectures often have little in common, it gives programmers the insight required to write effective code in high-level languages.

Assembly language is also used primarily for direct hardware manipulation, access to specialized processor instructions, or to address critical performance issues. Assembly is excellent for speed optimization.


1. Programming from the Ground Up by Jonathan Bartlett

Programming From The Ground UpProgramming from the Ground Up is an introductory book to programming and computer science using assembly language. It teaches assembly language for x86 processors and Linux. It assumes the reader has never programmed before, and introduces the concepts of variables, functions, and flow control.

The reason for using assembly language is to get the reader thinking in terms of how the computer actually works underneath. Knowing how the computer works from a “bare-metal” standpoint is often the difference between top-level programmers and programmers who can never quite master their art.

This book should teach the reader to understand how a program works and interacts with other programs, be able to read programmers’ code and learn how they work, to learn new programming languages quickly, and also to learn advanced concept in computer science quickly. The book includes review exercises at the end of each chapter.

Chapters cover:

  • Introduction.
  • Computer Architecture – structure of computer memory, the CPU, interpreting memory, and data accessing methods.
  • Your First Programs – teaches the reader the process for writing and building Linux assembly-language programs, the structure of assembly-language programs, and a few assembly-language commands.
  • All About Functions – looks at how functions work, assembly-language functions using the C calling convention, and recursive functions.
  • Dealing with Files – the UNIX file concept, buffers and .bss, standard and special files, and using files in a program.
  • Reading and Writing Simple Records – deals with reading and writing simple fixed-length records.
  • Developing Robust Programs – deals with developing programs that handle error conditions gracefully. This is known as robust programs.
  • Sharing Functions with Code Libraries – using a shared library, how shared libraries work, finding information about libraries, useful functions, and building a shared library.
  • Intermediate Memory Topics – how a computer views memory, the memory layout of a Linux program, getting more memory, a simple memory manager, and more.
  • Counting Like a Computer.
  • High Level Languages – looks at a “real-world” programming language.
  • Optimization – focuses on speed optimization.
  • Moving on from Here.
  • Appendices.

Permission is granted to copy, distribute and/or modify the book under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation.

Read the book


2. Reverse Engineering for Beginners by Dennis Yurichev

Reverse Engineering for BeginnersReverse Engineering for Beginners offers a primer on reverse-engineering, delving into disassembly code-level reverse engineering and explaining how to decipher assembly language for those beginners who would like to learn to understand x86 (which accounts for almost all executable software in the world) and ARM code created by C/C++ compilers. It discusses x86/x64, ARM/ARM64, MIPS, and Java/JVM.

Chapters cover:

  • Code patterns – Hello, world!, Stack, printf(), scanf(), accessing passed arguments, pointers, GOTO, conditional jumps, switch()/case/default, loops, floating-point unit, arrays, manipulating specific bit(s), structures, unions, pointers to functions, 64-bit values in 32-bit environment, and more.
  • Important fundamentals – endianness, memory, and CPU.
  • Slightly more advance examples – temperature converting, Fibonacci numbers, iterators, Duff’s device, inline functions, variadic functions, strings trimming, obfuscation, C++, and more.
  • Finding important/interesting stuff in the code – strings, constants, suspicious code patterns, and more.
  • OS-specific – arguments passing methods, thread local storage – system calls, Linux, and more.
  • Tools.
  • Examples of reversing proprietary file formats.

The book is available in Russian and English, and there are partial translations in Chinese, German, French, Italian, and Brazilian Portuguese.

This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Read the book


3. PC Assembly Language by Paul Carter

PC Assembly Language

PC Assembly Language offers a good tutorial on 32-bit protected mode assembly programming on the x86 processor.

The tutorial has extensive coverage of interfacing assembly and C code and so will interest C programmers who want to learn about how C works under the hood.

All the examples use the free NASM (Netwide) assembler.

Chapters cover:

  • Introduction – number systems, computer organization, assembly language, and creating a program.
  • Basic Assembly Language – explains how to work with integers, control structures, translating standard control structures. The chapter also looks at a program that finds prime numbers.
  • Bit Operations – shift operations, Boolean bitwise operations, avoiding conditional branches, manipulating bits in C, big and little endian representations, and counting bits.
  • Subprograms – looks at using subprograms to make modular programs and to interface with high level languages.
  • Arrays – defining arrays, and array/string instructions.
  • Floating Point – floating point representation, floating point arithmetic, the numeric coprocessor.
  • Structures and C++.

The book may be reproduced and distributed in its entirety, provided that no charge is made for the document itself, without the author’s consent.

Read the book


4. The Art of Assembly Language Programming by Randall Hyde

The Art of Assembly Language The Art of Assembly Language Programming (AoA), Randy Hyde’s acclaimed text on assembly language programming, is the most-often recommended book on 80×86 assembly language programming in newsgroups, on web sites, and by word of mouth.

AoA teaches the fundamentals one must know to be considered an assembly language programmer, and AoA was written by a recognized expert in x86 assembly language programming.

There are 4 different editions available.

Read the book


Next page: Page 2 – x86-64 Assembly Language Programming with Ubuntu and more books

Pages in this article:
Page 1 – Programming from the Ground Up and more books
Page 2 – x86-64 Assembly Language Programming with Ubuntu and more books


All books in this series:

Free Programming Books
AdaALGOL-like programming language, extended from Pascal and other languages
AgdaDependently typed functional language based on intuitionistic Type Theory
ArduinoInexpensive, flexible, open source microcontroller platform
AssemblyAs close to writing machine code without writing in pure hexadecimal
AwkVersatile language designed for pattern scanning and processing language
BashShell and command language; popular both as a shell and a scripting language
BASICBeginner’s All-purpose Symbolic Instruction Code
CGeneral-purpose, procedural, portable, high-level language
C++General-purpose, portable, free-form, multi-paradigm language
C#Combines the power and flexibility of C++ with the simplicity of Visual Basic
ClojureDialect of the Lisp programming language
ClojureScriptCompiler for Clojure that targets JavaScript
COBOLCommon Business-Oriented Language
CoffeeScriptTranscompiles into JavaScript inspired by Ruby, Python and Haskell
CoqDependently typed language similar to Agda, Idris, F* and others
CrystalGeneral-purpose, concurrent, multi-paradigm, object-oriented language
CSSCSS (Cascading Style Sheets) specifies a web page’s appearance
DGeneral-purpose systems programming language with a C-like syntax
DartClient-optimized language for fast apps on multiple platforms
DylanMulti-paradigm language supporting functional and object-oriented coding
ECMAScriptBest known as the language embedded in web browsers
EiffelObject-oriented language designed by Bertrand Meyer
ElixirRelatively new functional language running on the Erlang virtual machine
ErlangGeneral-purpose, concurrent, declarative, functional language
F#Uses functional, imperative, and object-oriented programming methods
FactorDynamic stack-based programming language
ForthImperative stack-based programming language
FortranThe first high-level language, using the first compiler
GoCompiled, statically typed programming language
GroovyPowerful, optionally typed and dynamic language
HaskellStandardized, general-purpose, polymorphically, statically typed language
HTMLHyperText Markup Language
IconWide variety of features for processing and presenting symbolic data
JArray programming language based primarily on APL
JavaGeneral-purpose, concurrent, class-based, object-oriented, high-level language
JavaScriptInterpreted, prototype-based, scripting language
JuliaHigh-level, high-performance language for technical computing
KotlinMore modern version of Java
LabVIEWDesigned to enable domain experts to build power systems quickly
LaTeXProfessional document preparation system and document markup language
LispUnique features - excellent to study programming constructs
LogoDialect of Lisp that features interactivity, modularity, extensibility
LuaDesigned as an embeddable scripting language
MarkdownPlain text formatting syntax designed to be easy-to-read and easy-to-write
Objective-CObject-oriented language that adds Smalltalk-style messaging to C
OCamlThe main implementation of the Caml language
PascalImperative and procedural language designed in the late 1960s
PerlHigh-level, general-purpose, interpreted, scripting, dynamic language
PHPPHP has been at the helm of the web for many years
PostScriptInterpreted, stack-based and Turing complete language
PrologA general purpose, declarative, logic programming language
PureScriptSmall strongly, statically typed language compiling to JavaScript
PythonGeneral-purpose, structured, powerful language
QMLHierarchical declarative language for user interface layout - JSON-like syntax
RDe facto standard among statisticians and data analysts
RacketGeneral-purpose, object-oriented, multi-paradigm, functional language
RakuMember of the Perl family of programming languages
RubyGeneral purpose, scripting, structured, flexible, fully object-oriented language
RustIdeal for systems, embedded, and other performance critical code
ScalaModern, object-functional, multi-paradigm, Java-based language
SchemeA general-purpose, functional language descended from Lisp and Algol
ScratchVisual programming language designed for 8-16 year-old children
SQLAccess and manipulate data held in a relational database management system
Standard MLGeneral-purpose functional language characterized as "Lisp with types"
SwiftPowerful and intuitive general-purpose programming language
TclDynamic language based on concepts of Lisp, C, and Unix shells
TeXMarkup and programming language - create professional quality typeset text
TypeScriptStrict syntactical superset of JavaScript adding optional static typing
ValaObject-oriented language, syntactically similar to C#
VHDLHardware description language used in electronic design automation
VimLPowerful scripting language of the Vim editor
XMLRules for defining semantic tags describing structure ad meaning
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments