Est. 1996 Advanced

NASM

The Netwide Assembler, a free, cross-platform x86 assembler with clean Intel-style syntax and a powerful macro processor, widely used for systems programming, OS development, and security research.

Created by Simon Tatham and Julian Hall

Paradigm Assembly, Imperative, Low-level
Typing None (untyped)
First Appeared 1996
Latest Version Version 3.01 (October 2025)

NASM, the Netwide Assembler, is a free, open-source assembler for the Intel x86 family of processors. First released in October 1996, it was created to fill a gap in the free-software ecosystem of the time: a high-quality, portable assembler that used the clean, register-on-the-left Intel syntax rather than the AT&T syntax favored by the GNU assembler. NASM can assemble 16-bit, 32-bit, and 64-bit x86 code and emit object files in a wide range of formats, which has made it a durable, cross-platform tool for operating-system development, security research, and performance-critical programming. Decades after its first release, NASM remains actively developed and is regarded as one of the most popular assemblers for x86 and Linux.

History & Origins

NASM was originally written by Simon Tatham, with assistance from Julian Hall. Tatham – also widely known as the author of the PuTTY SSH client – began the project to provide a free assembler with a clean, consistent syntax and a genuinely useful macro system, qualities that the available free tools of the mid-1990s lacked. The first public release, version 0.90, appeared in October 1996 and supported assembling code to DOS .OBJ files for 16-bit programs.

Shortly afterward, version 0.91 introduced RDOFF (the Relocatable Dynamic Object File Format), an experimental object format devised by Julian Hall. RDOFF was an attempt to define a simple, assembler-native linkable format; while it was retained for many years, it remained a niche feature and was eventually deprecated and disabled.

Over time, maintenance of NASM passed from its original authors to a volunteer team. By 2016 the project was led by H. Peter Anvin, a prominent Linux kernel contributor, with development hosted in a public source repository and ongoing releases adding support for new x86 instruction-set extensions.

Design Philosophy

NASM was built around a few clear principles that distinguish it from other assemblers of its era:

  • Intel syntax by default. NASM uses the instruction destination, source ordering and bracket-based memory addressing found in Intel’s own documentation, which many programmers find more readable than AT&T syntax. This makes NASM source map directly onto Intel and AMD reference manuals.
  • Explicitness over guesswork. NASM deliberately avoids inferring operand sizes from context. Where ambiguity exists – such as the size of a memory operand – the programmer must state it explicitly (for example, mov byte [count], 1). This predictability reduces a class of subtle bugs.
  • A powerful macro processor. NASM ships with a sophisticated preprocessor supporting single-line and multi-line macros, conditional assembly, repetition, local labels, and context stacks. This macro system is one of NASM’s most distinctive strengths.
  • Portability. Rather than tying itself to one platform’s object format, NASM was designed from early on to emit multiple output formats so the same toolchain could target many operating systems.

Key Features

Output Formats

A defining feature of NASM is the breadth of object and binary formats it can produce. These include:

FormatTypical Target
binFlat raw binaries (bootloaders, DOS .COM)
elf32 / elf64Linux and other Unix-like systems
macho32 / macho64macOS
win32 / win64 (COFF)Windows
objOMF, used by DOS and OS/2 toolchains
aoutOlder Unix a.out format

Position-independent code is supported for ELF object files, which is important for building shared libraries on Linux.

Architecture Coverage

NASM assembles 16-bit, 32-bit (IA-32), and 64-bit (x86-64) code. It tracks the evolution of the x86 instruction set closely, with modern releases adding support for SIMD families such as SSE, AVX, and AVX-512, and most recently Intel’s Advanced Performance Extensions (APX) and AVX10.

The Preprocessor

NASM’s macro language is effectively a small programming language layered on top of assembly. Single-line macros (%define), multi-line macros (%macro / %endmacro), conditional directives (%if, %ifdef, %else), and repetition (%rep) allow programmers to build reusable abstractions, generate tables at assembly time, and write portable code across the formats and modes NASM supports.

Evolution

NASM’s most significant architectural milestone came with version 2.00, released on November 28, 2007, which added full support for the x86-64 instruction set as 64-bit computing became mainstream. In July 2009, version 2.07 relicensed the project from the LGPL to the simplified 2-clause BSD license, simplifying redistribution and embedding.

Through the 2.x series, NASM steadily expanded its instruction support, refined its preprocessor, and improved its output formats. Long-deprecated features were retired – the RDOFF object format, for instance, was disabled starting in version 2.15.04. In October 2025, the project reached version 3.00, headlined by support for Intel APX and AVX10, with version 3.01 following soon after with additional output-format and preprocessor refinements.

Current Relevance

NASM remains in active development and continues to track new x86 instruction-set extensions as Intel and AMD release them. It is packaged by virtually every major Linux distribution and is freely available for Windows, macOS, and other platforms. Its combination of a permissive BSD license, clean Intel syntax, broad format support, and a capable macro system keeps it a default choice whenever developers need to write x86 assembly directly rather than rely on a compiler’s code generation.

It is frequently paired with, and is the spiritual ancestor of, YASM – a rewrite designed to be largely compatible with NASM syntax while offering a modular architecture. Many projects accept either assembler, a testament to the influence of NASM’s syntax conventions.

Why It Matters

NASM established a free, portable, well-documented standard for writing x86 assembly with Intel syntax at a time when the dominant free option used AT&T syntax. For generations of students, OS developers, and security researchers, NASM has been the gateway to understanding how software actually executes on x86 hardware – from boot sectors and interrupt handlers to shellcode and hand-optimized SIMD kernels. Its longevity, spanning from 16-bit DOS programs in 1996 to APX and AVX10 support in 2025, demonstrates both the staying power of the x86 architecture and the enduring value of a tool that gives programmers direct, unambiguous control over the machine.

Timeline

1996
NASM version 0.90 released in October by Simon Tatham, with assistance from Julian Hall -- a free assembler with clean Intel-style syntax and support for DOS .OBJ output
1996
Version 0.91 introduced RDOFF (Relocatable Dynamic Object File Format), an early effort by Julian Hall toward a custom object format
2007
Version 2.00 released on November 28, adding support for the x86-64 (64-bit) instruction set
2009
Version 2.07 (July) relicensed NASM from the LGPL to the simplified 2-clause BSD license
2016
Project maintained by a small team led by H. Peter Anvin, with development hosted on a public source repository
2020
The legacy RDOFF object format was disabled starting in version 2.15.04, reflecting its long-deprecated status
2025
Version 3.00 released in October with support for Intel Advanced Performance Extensions (APX) and AVX10, followed shortly by version 3.01

Notable Uses & Legacy

Operating System Development

NASM is a popular choice for hobby and educational operating systems, bootloaders, and bare-metal code. Its support for flat binary output (.bin) and 16-bit real-mode code makes it well-suited for writing boot sectors and early kernel startup routines.

Security Research and Exploit Development

NASM is widely used in the security community to write and assemble shellcode, craft proof-of-concept exploits, and study low-level x86 behavior, thanks to its readable Intel syntax and precise control over generated machine code.

Performance-Critical Libraries

Projects that need hand-optimized SIMD routines have used NASM to assemble x86 assembly. The x264 video encoder and FFmpeg, for example, have relied on NASM (and the closely related YASM) to build their hand-written assembly modules.

Education and Computer Architecture Courses

NASM is a common teaching tool for assembly language and computer architecture courses because it is free, cross-platform, well-documented, and uses Intel syntax that maps cleanly to Intel and AMD reference manuals.

Cross-Platform Toolchains

Because NASM emits ELF, Mach-O, COFF, OMF, a.out, and raw binary output, it is used in build pipelines that target Linux, Windows, macOS, OS/2, and DOS from a single assembler with consistent syntax.

Language Influence

Influenced By

Intel x86 Assembly Microsoft Macro Assembler (MASM)

Influenced

YASM

Running Today

Run examples using the official Docker image:

docker pull esolang/x86asm-nasm:latest

Example usage:

docker run --rm -v $(pwd):/code -w /code esolang/x86asm-nasm x86asm-nasm hello.asm
Last updated: