FASM

Open source assembler for x86 processors


title: "FASM" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["2000-software", "assemblers", "dos-software", "free-software-primarily-written-in-assembly-language", "linux-programming-tools", "programming-tools-for-windows", "self-hosting-software", "unix-programming-tools"] description: "Open source assembler for x86 processors" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/FASM" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Open source assembler for x86 processors ::

::data[format=table title="Infobox software"]

FieldValue
nameFASM
screenshotFASM2.png
captionScreenshot with supplied example
developerTomasz Grysztar
released
latest release version
latest release date
programming languageAssembly
operating_systemUnix-like, Linux, Windows and IDE, MS-DOS and IDE, OpenBSD, etc., MenuetOS, KolibriOS, OctaOS, DexOS and IDE, SkyOS, Solar_OS
platformx86, x86-64
genreAssembler
licenseSimplified BSD with a weak copyleft clause
website
::

| name = FASM | screenshot = FASM2.png | caption = Screenshot with supplied example | developer = Tomasz Grysztar | released = | latest release version = | latest release date = | latest_preview_version = | latest_preview_date = | programming language = Assembly | operating_system = Unix-like, Linux, Windows and IDE, MS-DOS and IDE, OpenBSD, etc., MenuetOS, KolibriOS, OctaOS, DexOS and IDE, SkyOS, Solar_OS | platform = x86, x86-64 | genre = Assembler | license = Simplified BSD with a weak copyleft clause | website =

FASM (flat assembler) is an assembler for x86 processors. It supports Intel-style assembly language on the IA-32 and x86-64 computer architectures. It claims high speed, size optimizations, operating system (OS) portability, and macro abilities. It is a low-level assembler and intentionally uses very few command-line options. It is free and open-source software.

All versions of FASM can directly output any of the following: flat "raw" binary (usable also as MS-DOS COM executable or SYS driver), objects: Executable and Linkable Format (ELF) or Common Object File Format (COFF) (classic or MS-specific), or executables in either MZ, ELF, or Portable Executable (PE) format (including WDM drivers, allows custom MZ DOS stub). An unofficial port targeting the ARM architecture also exists.

History

The project was started in 1999 by Tomasz Grysztar, a.k.a. Privalov, at that time an undergraduate student of mathematics from Poland. It was released publicly in March 2000. FASM is completely written in assembly language and comes with full source. It is self-hosting and has been able to assemble itself since version 0.90 (May 4, 1999).

FASM originally ran in 16-bit flat real mode. 32-bit support was added and then supplemented with optional DPMI support. Designed to be easy to port to any operating system with flat 32-bit addressing, it was ported to Windows, then Linux.

Design

FASM does not support as many high-level statements as MASM or TASM. It provides syntax features and macros, which make it possible to customize or create missing statements. Its memory-addressing syntax is similar to TASM's ideal mode and NASM. Brackets are used to denote memory operands as in both assemblers, but their size is placed outside the brackets, like in NASM.

FASM is a multi-pass assembler. It makes extensive code-size optimization and allows unconstrained forward referencing. An unusual FASM construct is defining procedures only if they are used somewhere in the code, something that in most languages is done per-object by the linker.

FASM is based on the "same source, same output" principle: the contents of the resulting file are not affected by the command line. Such an approach saves FASM sources from compiling problems often present in many assembly projects. On the other hand, it makes it harder to maintain a project that consists of multiple separately compiled source files or mixed-language projects. However, there exists a Win32 wrapper called FA, which mitigates this problem. FASM projects can be built from one source file directly into an executable file without a linking stage.

IDE

Fresh, a project started by John Found, is an integrated development environment for FASM under Windows and Linux.

Use

Operating systems written with FASM:

Compilers that use FASM as a backend:

References

References

  1. Grysztar. (2008-05-12). "Flat Assembler Programmer's Manual".
  2. (2008-03-20). "FASMARM".
  3. (2004-08-12). "Interview with Privalov the author of FASM".
  4. Grysztar. (2000-03-15). "flat assembler".
  5. Hyde. "Which Assembler is the Best?".
  6. Grysztar. "Flat Assembler Design Principles".
  7. Grysztar. "FA – command line extension for fasm".
  8. Found, John. "Fresh ID project".
  9. "MenuetOS".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

2000-softwareassemblersdos-softwarefree-software-primarily-written-in-assembly-languagelinux-programming-toolsprogramming-tools-for-windowsself-hosting-softwareunix-programming-tools