LLMpediaThe first transparent, open encyclopedia generated by LLMs

NASM

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Equinox Fitness Club Hop 4
Expansion Funnel Raw 81 → Dedup 14 → NER 11 → Enqueued 9
1. Extracted81
2. After dedup14 (None)
3. After NER11 (None)
Rejected: 3 (not NE: 3)
4. Enqueued9 (None)
Similarity rejected: 2
NASM
NameNASM
AcronymNASM
First released1991
DeveloperNetwide Assembler Project
Operating systemMultiplatform
LicenseBSD-like

NASM. The Netwide Assembler is an open-source x86 and x86-64 assembler for Intel-style syntax that targets Linux, Microsoft Windows, FreeBSD, NetBSD, and other Unix-like systems; it assembles source code into object formats such as ELF, COFF, Mach-O, and Win32. Widely used in systems programming, bootloader development, and compiler backends, NASM interoperates with assemblers, linkers, and debuggers associated with projects like the GNU Compiler Collection, Binutils, GNU Debugger, LLVM, and linkers.

Overview

NASM provides a low-level mnemonic syntax for the x86-64 and IA-32 instruction sets, supporting directives for data definition, macros, and conditional assembly while outputting object files consumed by toolchains for Linux kernel, Microsoft Visual Studio, FreeBSD kernel, and embedded runtime images. Its syntax contrasts with the AT&T syntax used by assemblers tied to GCC and integrates with binary utilities such as objdump, readelf, and strip. NASM emphasizes portability across CPUs made by Intel and AMD and is used alongside projects like GRUB, QEMU, Bochs, and SeaBIOS.

History

NASM originated in the early 1990s as part of the wider ecosystem of x86 development tools that include GCC, Binutils, and assemblers like MASM and TASM. Its development paralleled advances in processor families—Pentium Pro, Pentium II, AMD Athlon—and responded to changes in object file standards such as the adoption of ELF on Linux and the evolution of PE/COFF on Windows NT. Over time NASM added support for x86-64 after the introduction of the AMD64 architecture, improved macro facilities inspired by languages like m4 and C preprocessor, and adapted to integration scenarios involving LLVM and Clang front ends.

Architecture and Features

NASM implements a two-pass assembly architecture enabling forward references and flexible symbol resolution, producing output in formats including ELF, COFF, Mach-O, a.out, and flat binary suitable for boot sector creation and BIOS routines. It supports addressing modes and instructions found in Intel 386, Pentium, Pentium Pro, SSE, SSE2, AVX, and later extensions introduced by Intel and AMD. Features include an expressive macro language with local symbols, conditional assembly directives comparable to those in MASM and GAS, and facilities for generating relocations used by linkers such as ld and gold. NASM's output aligns with debuggers including GDB by emitting appropriate debug symbols when combined with corresponding tools.

Usage and Tooling

Developers use NASM in toolchains with assemblers, linkers, and debuggers that include GCC, LLVM, Binutils, LD, Gold, GDB, and platform-specific tools like cl from Microsoft Visual Studio for object linking. Common workflows feature hand-written routines in projects such as Linux kernel, GRUB, and bootloaders for Coreboot or SeaBIOS, as well as performance-critical paths in virtual machine monitors like QEMU and emulators like DOSBox. Build systems such as GNU Make, CMake, Bazel, and Meson often integrate NASM assembly steps, and package maintainers for distributions like Debian, Ubuntu, Fedora, and Arch Linux include NASM in build dependencies. Debugging and inspection use tools like objdump, readelf, strace, and ltrace in conjunction with symbol formats from DWARF when available.

Development and Community

NASM's development occurs through community repositories and mailing lists that mirror collaborative models used by GitHub, GNU Savannah, and other open-source hosting platforms; contributions come from developers familiar with Intel and AMD instruction set intricacies and from maintainers of downstream projects such as GRUB, QEMU, and Coreboot. Documentation and tutorials reference canonical texts like Intel 64 and IA-32 Architectures Software Developer’s Manual and community resources including Stack Overflow, archived FAQs, and university courses on systems programming. Packaging and distribution are handled by maintainers for Debian, Fedora, FreeBSD Ports, and Homebrew repositories, while integration testing aligns with continuous integration services employed by projects like Travis CI and GitLab CI.

Criticism and Limitations

Critics note that NASM's Intel-style syntax differs from the AT&T syntax used by GAS and tooling expectations in projects tied tightly to GCC, requiring developers to translate examples from sources such as UNIX System V documentation or assemblers like MASM. Its macro language, while powerful, lacks some higher-level abstractions found in assemblers with integrated preprocessors like FASM and can present portability challenges across object formats targeting Windows versus Unix-like systems. Additionally, support for the newest instruction set extensions often lags behind vendor documentation from Intel and AMD, necessitating reliance on nascent upstream implementations in projects such as LLVM or third-party assemblers.

Category:Assembly language