Next Chapter | Contents | Index
The Netwide Assembler, NASM, is an 80x86 assembler designed for
portability and modularity. It supports a range of object file formats,
including Linux
and ELF, NetBSD/FreeBSD,
COFF, Microsoft 16-bit OBJ and Win32. It will also output plain binary
files. Its syntax is designed to be simple and easy to understand, similar
to Intel's but less complex. It supports Pentium, P6 and MMX opcodes, and
has macro capability.
The Netwide Assembler grew out of an idea on
(or possibly
- I forget which), which was
essentially that there didn't seem to be a good free x86-series assembler
around, and that maybe someone ought to write one.
a86
is good, but not free, and in particular
you don't get any 32-bit capability until you pay. It's DOS only, too.
gas
is free, and ports over DOS and Unix, but
it's not very good, since it's designed to be a back end to
gcc
, which always feeds it correct code. So its
error checking is minimal. Also, its syntax is horrible, from the point of
view of anyone trying to actually write anything in it. Plus you
can't write 16-bit code in it (properly).
as86
is Linux-specific, and (my version at
least) doesn't seem to have much (or any) documentation.
So here, for your coding pleasure, is NASM. At present it's still in prototype stage - we don't promise that it can outperform any of these assemblers. But please, please send us bug reports, fixes, helpful information, and anything else you can get your hands on (and thanks to the many people who've done this already! You all know who you are), and we'll improve it out of all recognition. Again.
Please see the file
, supplied as part
of any NASM distribution archive, for the licence conditions under which
you may use NASM.
The current version of NASM (since 0.98) are maintained by H. Peter
Anvin,
.
If you want to report a bug, please read
section 10.2 first.
NASM has a WWW page at
.
The original authors are e-mailable as
and
.
New releases of NASM are uploaded to
,
,
and
.
Announcements are posted to
,
,
and
(the last one is done automagically by uploading to
).
If you don't have Usenet access, or would rather be informed by e-mail
when new releases come out, you can subscribe to the
email list by sending an email
containing the line
to
.
If you want information about NASM beta releases, please subscribe to
the
email list by sending an email
containing the line
to
.
Once you've obtained the DOS archive for NASM,
(where
denotes the version number of NASM contained in the archive), unpack it
into its own directory (for example
).
The archive will contain four executable files: the NASM executable
files
and
, and the NDISASM executable files
and
. In each case, the file whose name
ends in
is a Win32 executable, designed to run
under Windows 95 or Windows NT Intel, and the other one is a 16-bit DOS
executable.
The only file NASM needs to run is its own executable, so copy (at
least) one of
and
to a directory on your PATH, or
alternatively edit
to add the
directory to your
. (If you're only installing the Win32
version, you may wish to rename it to
.)
That's it - NASM is installed. You don't need the
directory to be present to run NASM (unless
you've added it to your
), so you can delete
it if you need to save space; however, you may want to keep the
documentation or test programs.
If you've downloaded the DOS source archive,
, the
directory will also contain the full NASM source code, and a selection of
Makefiles you can (hopefully) use to rebuild your copy of NASM from
scratch. The file
lists the various
Makefiles and which compilers they work with.
Note that the source files
,
,
and
are automatically generated from the
master instruction table
by a Perl
script; the file
is generated from
by another Perl script. Although the
NASM 0.98 distribution includes these generated files, you will need to
rebuild them (and hence, will need a Perl interpreter) if you change
,
or the documentation. It is possible future source distributions may not
include these files at all. Ports of Perl for a variety of platforms,
including DOS and Windows, are available from
www.cpan.org.
Once you've obtained the Unix source archive for NASM,
(where
denotes the version number of NASM contained
in the archive), unpack it into a directory such as
. The archive, when unpacked, will
create its own subdirectory
.
NASM is an auto-configuring package: once you've unpacked it,
to the directory it's been unpacked into and
type
. This shell script will find the
best C compiler to use for building NASM and set up Makefiles accordingly.
Once NASM has auto-configured, you can type
to build the
and
binaries, and then
to install them in
and install the man pages
and
in
. Alternatively, you can give
options such as
to the
script (see the file
for more details), or install the
programs yourself.
NASM also comes with a set of utilities for handling the RDOFF custom
object-file format, which are in the
subdirectory of the NASM archive. You can build these with
and install them with
, if you want them.
If NASM fails to auto-configure, you may still be able to make it
compile by using the fall-back Unix makefile
. Copy or rename that file to
and try typing
. There is also a
file in the
subdirectory.