Jump to content

Netwide Assembler: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Revolus (talk | contribs)
m →‎Features: unlikely
→‎Features: NASM syntax isn't exactly Intel
Line 21: Line 21:
The variety of output formats allows one to [[retargeting|retarget]] programs to virtually any x86 operating system. In addition, NASM can create [[flat binary file]]s, usable in writing [[boot loaders]], [[Read-only memory|ROM]] images, and various facets of OS development.<ref name="Manual"/> NASM can run on non-x86 platforms, such as [[SPARC]] and [[PowerPC]], though it cannot output programs usable by those machines.
The variety of output formats allows one to [[retargeting|retarget]] programs to virtually any x86 operating system. In addition, NASM can create [[flat binary file]]s, usable in writing [[boot loaders]], [[Read-only memory|ROM]] images, and various facets of OS development.<ref name="Manual"/> NASM can run on non-x86 platforms, such as [[SPARC]] and [[PowerPC]], though it cannot output programs usable by those machines.


NASM uses [[Intel]] [[Intel assembly syntax|assembly syntax]] instead of [[AT&T]] syntax.<ref name="Hyde">{{cite web|url=http://webster.cs.ucr.edu/AsmTools/NASM/|title=NASM: The Netwide Assembler|date=|accessdate=2008-06-27|author=[[Randall Hyde]]}}</ref> It also avoids features such as automatic generation of [[x86 memory segmentation|segment]] overrides (and the related ASSUME directive) used by [[MASM]] and compatible assemblers.<ref name="Manual"/>
NASM uses variation of [[Intel]] [[Intel assembly syntax|assembly syntax]] instead of [[AT&T]] syntax.<ref name="Hyde">{{cite web|url=http://webster.cs.ucr.edu/AsmTools/NASM/|title=NASM: The Netwide Assembler|date=|accessdate=2008-06-27|author=[[Randall Hyde]]}}</ref> It also avoids features such as automatic generation of [[x86 memory segmentation|segment]] overrides (and the related ASSUME directive) used by [[MASM]] and compatible assemblers.<ref name="Manual"/>


== Linking ==
== Linking ==

Revision as of 09:05, 8 May 2010

Netwide Assembler
Original author(s)Simon Tatham, Julian Hall
Developer(s)H. Peter Anvin, et al.
Stable release
2.08.01 / March 10, 2010 (2010-03-10)
Repository
Operating systemMicrosoft Windows, Unix-like, OS/2, Mac OS, DOS
Available inEnglish
Typex86 assembler
License2-clause BSD
Websitehttp://www.nasm.us/

The Netwide Assembler (NASM) is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs. NASM is considered to be one of the most popular assemblers for Linux[1] and is the second most popular assembler overall.[2]

NASM was originally written by Simon Tatham with assistance from Julian Hall, and is currently maintained by a small team led by H. Peter Anvin.[3] It is available as free software under the terms of the simplified (2-clause) BSD license.[4]

Features

NASM can output several binary formats including COFF, Portable Executable, a.out, ELF and Mach-O, though Position-independent code is only supported for ELF object files. NASM also has its own binary format called RDOFF.[5]

The variety of output formats allows one to retarget programs to virtually any x86 operating system. In addition, NASM can create flat binary files, usable in writing boot loaders, ROM images, and various facets of OS development.[5] NASM can run on non-x86 platforms, such as SPARC and PowerPC, though it cannot output programs usable by those machines.

NASM uses variation of Intel assembly syntax instead of AT&T syntax.[6] It also avoids features such as automatic generation of segment overrides (and the related ASSUME directive) used by MASM and compatible assemblers.[5]

Linking

NASM principally outputs object files, which are generally not executable in and of themselves. The only exception to this are flat binaries (e.g., .COM)[5] which are inherently limited in modern use. To translate the object files into executable programs, an appropriate linker must be used, such as the Visual Studio "LINK" utility for Windows or ld for UNIX-like systems.

Development

On 28 November, 2007, version 2.00 was released, adding support for x86-64 extensions.[3] The development versions are not uploaded to SourceForge.net; instead, they are checked in to the project's own Git repository with binary snapshots available from the project web page.

A search engine for NASM docs is also available.[7]

See also

References

  1. ^ Ram Narayan. "Linux assemblers: A comparison of GAS and NASM". two of the most popular assemblers for Linux, GNU Assembler (GAS) and Netwide Assembler (NASM)
  2. ^ Randall Hyde. "Which Assembler is the Best?". Retrieved 2008-05-18. In second place, undoubtedly, is the NASM assembler.
  3. ^ a b "The Netwide Assembler". Retrieved 2008-06-27.
  4. ^ "NASM Version History". Retrieved 2009-07-19.
  5. ^ a b c d "NASM Manual". Retrieved 2009-08-15.
  6. ^ Randall Hyde. "NASM: The Netwide Assembler". Retrieved 2008-06-27.
  7. ^ "NASM Doc Search Engine". Retrieved 2009-09-14.

Further reading

  • Jeff Duntemann (2000). Assembly Language Step by Step. J Wiley and Sons. ISBN 0471375233.

External links