Set up a development environment

 

Install NASM

 First off all you need to install the Netwide Assembler.  You can do this from source and compile it yourself or you with sudo apt-get install nasm.  The latter method installs nasm in the /usr/bin/ directory.  For users of linux based on Debian I got a deb package of nasm 2.10.09 together with the documentation and rdoff. Linux Mint users (and probably all users with a Linux Ubuntu based system can get it from the Linux Mint Community or by clicking this link.  Ether way, you have to install it.  You also need to install the GNU BinUtils which you also can install with sudo apt-get install binutils or build it yourself.

Set NASMENV

In your home directory you have to modify or create the file .bashrc. (On Linux Mint I've struggled for an hour to finally know that it must be .bashrc in my home folder)
open a terminal and type nano ~/.bashrc and add at the end of the file the next line:

export NASMENV=-i/[path to the include folder]/  (example: home/agguro/nasm/include/)   (don't forget the / at the end). Close the file with CTRL-X and confirm the change (with Y).
Create a directory nasm/include/ in your home folder.  Next time you log in nasm knows where to look for the include files you will use so you don't have to enter the full path to an include file in your source files.
In the same terminal you can enter the same command to set the environment parameter already.  You can download the include files here and unpack them in the just created folder.

The debugger

No program is perfect from the first moment unless you are writing really tiny ones and / or if you are a super expert in assembly language and still... .  Eitherway a debugger is a must for large projects (or if you like to see how programs looks like in assembly language.  A good debugger I use quit a lot is Evan's Debugger.  You can find on the programmers website instructions where to download and to build it.  On this site I can offer an already builded version for 64 bits Linux.  The compressed file contains the already build debugger, you only have to create a folder in your home directory (or somewhere else as long as you know where you uncompressed it), set the directories to your plugins and symbols (both directories are already included in the file and setup your menu items.

Beside this debugger you can ofcourse use gdb but I prefer not to use it a lot.

Other tools

 The Netwide Assembler is shipped with ndisasm.  You can also disassemble with objdump and on the same site as Evans Debugger you can find a disassembler for 32 and 64 bits.  Up to you to decide which one you, eventually, will use.  Also objdump, gdb, ldd, qemu, mkfs and dd are used in the examples on this site.  All available in the synaptic package manager.
The GUI tools for people who prefer X-server applications I use quit often are:

bless-48x48 Bless Hexeditor
edb100-logo Evan's Debugger
sasm Sasm Assembler IDE

Also various macro packages like nasmxand even for OOP with NASM can be useful. Always check those sites for updates.

The source code

All source code presented on this website is also hosted on https://code.google.com/p/agguro-nasm-samples/source/browse/  and can be downloaded with subversion by issuing the following command:

svn checkout http://agguro-nasm-samples.googlecode.com/svn/trunk/ agguro-nasm-samples-read-only

Subversion itself can be installed with sudo apt-get install subversion or click here to install.

To browse this website, you can visit the download page