old-www/HOWTO/Assembly-HOWTO/nasm.html

267 lines
3.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>NASM</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Linux Assembly HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="Assemblers"
HREF="assemblers.html"><LINK
REL="PREVIOUS"
TITLE="GAS"
HREF="gas.html"><LINK
REL="NEXT"
TITLE="Other Assemblers"
HREF="other.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux Assembly HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="gas.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. Assemblers</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="other.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="AEN437"
></A
>3.3. NASM</H1
><P
>&#13;The Netwide Assembler project provides cool i386 assembler, written in C, that
should be modular enough to eventually support all known syntaxes and object
formats.
</P
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="AEN440"
></A
>3.3.1. Where to find NASM</H2
><P
>&#13;http://www.nasm.us,
http://sourceforge.net/projects/nasm/
</P
><P
>&#13;Binary release on your usual metalab mirror in
<TT
CLASS="filename"
>devel/lang/asm/</TT
> directory. Should also be available as
<TT
CLASS="filename"
>.rpm</TT
> or <TT
CLASS="filename"
>.deb</TT
> in your usual Linux
distribution.
</P
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="AEN449"
></A
>3.3.2. What it does</H2
><P
>&#13;The syntax is Intel-style. Comprehensive macroprocessing support is integrated.
</P
><P
>&#13;Supported object file formats are <TT
CLASS="literal"
>bin</TT
>,
<TT
CLASS="literal"
>aout</TT
>, <TT
CLASS="literal"
>coff</TT
>, <TT
CLASS="literal"
>elf</TT
>,
<TT
CLASS="literal"
>as86</TT
>, <TT
CLASS="literal"
>obj</TT
> (DOS), <TT
CLASS="literal"
>win32</TT
>,
<TT
CLASS="literal"
>rdf</TT
> (their own format).
</P
><P
>&#13;NASM can be used as a backend for the free LCC compiler (support files
included).
</P
><P
>&#13;Unless you're using BCC as a 16-bit compiler (which is out of scope of this
32-bit HOWTO), you should definitely use NASM instead of say AS86 or MASM,
because it runs on all platforms.
</P
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>&#13;NASM comes with a disassembler, NDISASM.
</P
></TD
></TR
></TABLE
></DIV
><P
>&#13;Its hand-written parser makes it much faster than GAS, though of course, it
doesn't support three bazillion different architectures. If you like
Intel-style syntax, as opposed to GAS syntax, then it should be the assembler
of choice...
</P
><P
>&#13;Note: There are few programs which may help you
to convert source code between AT&#38;T and Intel assembler syntaxes; some of
the are capable of performing conversion in both directions.
</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="gas.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="other.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>GAS</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="assemblers.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Other Assemblers</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>