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

Introduction

Basic Assembly Language

Bit Operations

Subprograms

Arrays

Floating Point

Structures and C++

Recent updates

Jul 7, 2010

Jae Beom Lee with help from others has created an improved (and smaller) Korean PDF.

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).