Home Programming Email me
PC Assembly Tutorial
PC Assembly Language

Welcome to my PC Assembly Page

I taught Computer Science at the University of Central Oklahoma for 10 years. During this time I taught an introductory course in PC Assembly Language programming. I grew frustrated at teaching 16-bit real mode programming and decided to change to 32-bit protected mode. However, I soon ran into a problem. I could not find a textbook that covered 32-bit protected mode assembly programming! So, I decided to write my own.

I also did not want students to have to go out and buy expensive software for the course. I decided to base the course on the free NASM (Netwide Assembler) and the free GNU gcc compiler (however, any 32-bit C compiler would work). Another advantage of these choices was that students could use Windows, Linux or FreeBSD to develop on. (In fact, I use Linux for my main development platform.)

Over one summer I wrote the bulk of this textbook and developed the examples using LaTeX. I made a feeble attempt to get the book published and then decided to publish it myself online for free. Why? To return something back to the developer community. I have used many open source products and wanted to make a modest contribution of my own.

PC Assembly Tutorial

The tutorial has extensive coverage of interfacing assembly and C code and so might be of interest to C programmers who want to learn about how C works under the hood. All the examples use the free NASM (Netwide) assembler. The tutorial only covers programming under 32-bit protected mode and requires a 32-bit protected mode compiler.

I have example code files for: DJGPP, Borland, Microsoft, Open Watcom and Linux C compilers. The examples in the text of the tutorial are for DJGPP only, but how to interface with the other compilers is discussed as well. The example files also include macros that allow easy input/output and debugging (register dumps, memory dumps, coprocessor dumps and stack dumps). If you plan on running the examples in the tutorial, you must download the appropriate example code file. It contains support files used by the examples in the tutorial (such as asm_io.inc).

Table of Contents

  1. Introduction
  2. Basic Assembly Language
  3. Bit Operations
  4. Subprograms
  5. Arrays
  6. Floating Point
  7. Structures and C++

Recent updates

Jul 7, 2010
Jae Beom Lee with help from others has created an improved (and smaller) Korean PDF.
Dec 8, 2009
Jae Beom Lee has corrected some typos in his Korean translation.
Nov 19, 2009
Jae Beom Lee has translated my tutorial to Korean! Thanks Lee!
Jun 29, 2009
Hard copy of text is now available from Lulu.com
Apr 26, 2009
Added new example code zip file for cygwin.
Aug 12, 2007
Leonardo Rodríguez Mújica has updated his Spanish translation to fix some mistakes.
Jan 21, 2007
Wu Xing has translated my book to Chinese! Thanks Wu Xing!
Dec 17, 2006
Ulrich Bicheler has translated my book to German! Thanks Ulrich!
Oct 18, 2006
Leonardo Rodríguez Mújica has translated my book to Spanish! Thanks Leonardo!
Sept 25, 2006
Giacomo Bruschi has translated my book to Italian! Thanks Giacomo!
Jul 23, 2006
Fixed some typos in the English edition.
Mar 20, 2005
Sébastien Le Ray has finished translating my entire book to French! Many thanks to Sébastien! I have also published a new version of the English version, mostly just fixes to some formatting problems introduced in the last version (of Oct 10, 2004).

Feedback is welcome. Next are links to the files:



(Files last updated on July 23, 2006 )

Language Translator Link to zip file
FrenchSébastien Le Ray PDF
ItalianGiacomo Bruschi PDF
SpanishLeonardo Rodríguez Mújica PDF
GermanUlrich Bicheler PDF
Simplified ChineseWu Xing PDF
Traditional ChineseWu Xing PDF
KoreanJae Beom Lee PDF

Example code:`

If you plan on running the code in the tutorial, you must get the appropriate zip file below: