Kip Irvine’s x86 assembly book is a good introduction to assembly. However, it requires using Visual Studio on Windows, both for the syntax and more importantly for the Irvine32 support library that the examples require. Happily, some folks have put together a Linux port of that library called Along32 and so using the crossplatform nasm assembler, one can make nearly full use of the book on Linux.
Below are the basic instructions for using nasm and this library.
Install nasm (if it is not already installed).
wget -c http://www.nasm.us/pub/nasm/releasebuilds/2.10rc3/nasm-2.10rc3.tar.gz
tar -xzf nasm-2.10rc3.tar.gz
rm -rf nasm-2.10rc3 nasm-2.10rc3.tar.gz
wget -c http://sourceforge.net/projects/along32/files/Along32-1.0.3.tar.gz/download
tar -xzf Along32-1.0.3.tar.gz
mkdir -p $HOME/nasm/lib $HOME/nasm/include
make install INSTDIR=$HOME/nasm/lib
cp ../Along32.inc $HOME/nasm/include
rm -rf Along32 Along32-1.0.3.tar.gz
Convert your program to nasm syntax. The instructions here should provide a good starting point. The
%includeline should be:
Assemble your program (assuming source is program.asm)
nasm -f elf -o program. o program.asm
Link your program.
gcc -o program program.o -lAlong32 -L$HOME/nasm/lib
Run your program.