diff options
Diffstat (limited to 'doc/html/nasmdoc1.html')
-rw-r--r-- | doc/html/nasmdoc1.html | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/doc/html/nasmdoc1.html b/doc/html/nasmdoc1.html new file mode 100644 index 0000000..d370895 --- /dev/null +++ b/doc/html/nasmdoc1.html @@ -0,0 +1,159 @@ +<html><head><title>NASM Manual</title></head> +<body><h1 align=center>The Netwide Assembler: NASM</h1> + +<p align=center><a href="nasmdoc2.html">Next Chapter</a> | +<a href="nasmdoc0.html">Contents</a> | +<a href="nasmdoci.html">Index</a> +<h2><a name="chapter-1">Chapter 1: Introduction</a></h2> +<h3><a name="section-1.1">1.1 What Is NASM?</a></h3> +<p>The Netwide Assembler, NASM, is an 80x86 and x86-64 assembler designed +for portability and modularity. It supports a range of object file formats, +including Linux and <code><nobr>*BSD</nobr></code> +<code><nobr>a.out</nobr></code>, <code><nobr>ELF</nobr></code>, +<code><nobr>COFF</nobr></code>, <code><nobr>Mach-O</nobr></code>, Microsoft +16-bit <code><nobr>OBJ</nobr></code>, <code><nobr>Win32</nobr></code> and +<code><nobr>Win64</nobr></code>. 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 all currently known x86 architectural +extensions, and has strong support for macros. +<h4><a name="section-1.1.1">1.1.1 Why Yet Another Assembler?</a></h4> +<p>The Netwide Assembler grew out of an idea on +<code><nobr>comp.lang.asm.x86</nobr></code> (or possibly +<code><nobr>alt.lang.asm</nobr></code> - I forget which), which was +essentially that there didn't seem to be a good <em>free</em> x86-series +assembler around, and that maybe someone ought to write one. +<ul> +<li><code><nobr>a86</nobr></code> is good, but not free, and in particular +you don't get any 32-bit capability until you pay. It's DOS only, too. +<li><code><nobr>gas</nobr></code> is free, and ports over to DOS and Unix, +but it's not very good, since it's designed to be a back end to +<code><nobr>gcc</nobr></code>, 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 <em>write</em> anything in it. Plus you +can't write 16-bit code in it (properly.) +<li><code><nobr>as86</nobr></code> is specific to Minix and Linux, and (my +version at least) doesn't seem to have much (or any) documentation. +<li><code><nobr>MASM</nobr></code> isn't very good, and it's (was) +expensive, and it runs only under DOS. +<li><code><nobr>TASM</nobr></code> is better, but still strives for MASM +compatibility, which means millions of directives and tons of red tape. And +its syntax is essentially MASM's, with the contradictions and quirks that +entails (although it sorts out some of those by means of Ideal mode.) It's +expensive too. And it's DOS-only. +</ul> +<p>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, <em>please</em> 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. +<h4><a name="section-1.1.2">1.1.2 License Conditions</a></h4> +<p>Please see the file <code><nobr>LICENSE</nobr></code>, supplied as part +of any NASM distribution archive, for the license conditions under which +you may use NASM. NASM is now under the so-called 2-clause BSD license, +also known as the simplified BSD license. +<p>Copyright 1996-2009 the NASM Authors - All rights reserved. +<p>Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +<ul> +<li>Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +<li>Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +</ul> +<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +<h3><a name="section-1.2">1.2 Contact Information</a></h3> +<p>The current version of NASM (since about 0.98.08) is maintained by a +team of developers, accessible through the +<code><nobr>nasm-devel</nobr></code> mailing list (see below for the link). +If you want to report a bug, please read +<a href="nasmdo12.html#section-12.2">section 12.2</a> first. +<p>NASM has a website at +<a href="http://www.nasm.us/"><code><nobr>http://www.nasm.us/</nobr></code></a>. +If it's not there, google for us! +<p>New releases, release candidates, and daily development snapshots of +NASM are available from the official web site. +<p>Announcements are posted to +<a href="news:comp.lang.asm.x86"><code><nobr>comp.lang.asm.x86</nobr></code></a>, +and to the web site +<a href="http://www.freshmeat.net/"><code><nobr>http://www.freshmeat.net/</nobr></code></a>. +<p>If you want information about the current development status, please +subscribe to the <code><nobr>nasm-devel</nobr></code> email list; see link +from the website. +<h3><a name="section-1.3">1.3 Installation</a></h3> +<h4><a name="section-1.3.1">1.3.1 Installing NASM under MS-DOS or Windows</a></h4> +<p>Once you've obtained the appropriate archive for NASM, +<code><nobr>nasm-XXX-dos.zip</nobr></code> or +<code><nobr>nasm-XXX-win32.zip</nobr></code> (where +<code><nobr>XXX</nobr></code> denotes the version number of NASM contained +in the archive), unpack it into its own directory (for example +<code><nobr>c:\nasm</nobr></code>). +<p>The archive will contain a set of executable files: the NASM executable +file <code><nobr>nasm.exe</nobr></code>, the NDISASM executable file +<code><nobr>ndisasm.exe</nobr></code>, and possibly additional utilities to +handle the RDOFF file format. +<p>The only file NASM needs to run is its own executable, so copy +<code><nobr>nasm.exe</nobr></code> to a directory on your PATH, or +alternatively edit <code><nobr>autoexec.bat</nobr></code> to add the +<code><nobr>nasm</nobr></code> directory to your +<code><nobr>PATH</nobr></code> (to do that under Windows XP, go to Start +> Control Panel > System > Advanced > Environment Variables; +these instructions may work under other versions of Windows as well.) +<p>That's it - NASM is installed. You don't need the nasm directory to be +present to run NASM (unless you've added it to your +<code><nobr>PATH</nobr></code>), so you can delete it if you need to save +space; however, you may want to keep the documentation or test programs. +<p>If you've downloaded the DOS source archive, +<code><nobr>nasm-XXX.zip</nobr></code>, the <code><nobr>nasm</nobr></code> +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. See the file <code><nobr>INSTALL</nobr></code> in the source +archive. +<p>Note that a number of files are generated from other files by Perl +scripts. Although the NASM source distribution includes these generated +files, you will need to rebuild them (and hence, will need a Perl +interpreter) if you change insns.dat, standard.mac 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 <a href="http://www.cpan.org/ports/">www.cpan.org</a>. +<h4><a name="section-1.3.2">1.3.2 Installing NASM under Unix</a></h4> +<p>Once you've obtained the Unix source archive for NASM, +<code><nobr>nasm-XXX.tar.gz</nobr></code> (where +<code><nobr>XXX</nobr></code> denotes the version number of NASM contained +in the archive), unpack it into a directory such as +<code><nobr>/usr/local/src</nobr></code>. The archive, when unpacked, will +create its own subdirectory <code><nobr>nasm-XXX</nobr></code>. +<p>NASM is an auto-configuring package: once you've unpacked it, +<code><nobr>cd</nobr></code> to the directory it's been unpacked into and +type <code><nobr>./configure</nobr></code>. This shell script will find the +best C compiler to use for building NASM and set up Makefiles accordingly. +<p>Once NASM has auto-configured, you can type +<code><nobr>make</nobr></code> to build the <code><nobr>nasm</nobr></code> +and <code><nobr>ndisasm</nobr></code> binaries, and then +<code><nobr>make install</nobr></code> to install them in +<code><nobr>/usr/local/bin</nobr></code> and install the man pages +<code><nobr>nasm.1</nobr></code> and <code><nobr>ndisasm.1</nobr></code> in +<code><nobr>/usr/local/man/man1</nobr></code>. Alternatively, you can give +options such as <code><nobr>--prefix</nobr></code> to the configure script +(see the file <code><nobr>INSTALL</nobr></code> for more details), or +install the programs yourself. +<p>NASM also comes with a set of utilities for handling the +<code><nobr>RDOFF</nobr></code> custom object-file format, which are in the +<code><nobr>rdoff</nobr></code> subdirectory of the NASM archive. You can +build these with <code><nobr>make rdf</nobr></code> and install them with +<code><nobr>make rdf_install</nobr></code>, if you want them. +<p align=center><a href="nasmdoc2.html">Next Chapter</a> | +<a href="nasmdoc0.html">Contents</a> | +<a href="nasmdoci.html">Index</a> +</body></html> |