FASM

Last updated
FASM
Developer(s) Tomasz Grysztar
Initial releaseMarch 2000;23 years ago (2000-03)
Stable release
1.73.30 [1]   OOjs UI icon edit-ltr-progressive.svg / 21 February 2022;16 months ago (21 February 2022)
Repository
Written inAssembly
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
Type Assembler
License Simplified BSD with a weak copyleft clause
Website flatassembler.net

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. [2] [3] It is a low-level assembler [3] and intentionally uses very few command-line options. It is free and open-source software.

Contents

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 (FASMARM) also exists. [4]

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. [5] [6] 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. [3] It provides syntax features and macros, which make it possible to customize or create missing statements. [5] 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. [7]

FASM is a multi-pass assembler. It makes extensive code-size optimization and allows unconstrained forward referencing. [3] [7] 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. [7] 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. [8] FASM projects can be built from one source file directly into an executable file without a linking stage. [3]

IDE

Fresh, an internet community supported project started by John Found, is an integrated development environment for FASM. [9] Fresh currently supports Microsoft Windows and Linux. [9]

Use

Operating systems written with FASM:

Compilers that use FASM as a backend:

See also

Related Research Articles

<span class="mw-page-title-main">Assembly language</span> Low-level programming language

In computer programming, assembly language, often referred to simply as Assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence between the instructions in the language and the architecture's machine code instructions. Assembly language usually has one statement per machine instruction (1:1), but constants, comments, assembler directives, symbolic labels of, e.g., memory locations, registers, and macros are generally also supported.

<span class="mw-page-title-main">Executable and Linkable Format</span> Standard file format for executables, object code, shared libraries, and core dumps.

In computing, the Executable and Linkable Format, is a common standard file format for executable files, object code, shared libraries, and core dumps. First published in the specification for the application binary interface (ABI) of the Unix operating system version named System V Release 4 (SVR4), and later in the Tool Interface Standard, it was quickly accepted among different vendors of Unix systems. In 1999, it was chosen as the standard binary file format for Unix and Unix-like systems on x86 processors by the 86open project.

<span class="mw-page-title-main">Netwide Assembler</span> Assembler for the Intel x86 architecture

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. It is considered one of the most popular assemblers for Linux and x86 chips.

The Portable Executable (PE) format is a file format for executables, object code, DLLs and others used in 32-bit and 64-bit versions of Windows operating systems. The PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. This includes dynamic library references for linking, API export and import tables, resource management data and thread-local storage (TLS) data. On NT operating systems, the PE format is used for EXE, DLL, SYS, MUI and other file types. The Unified Extensible Firmware Interface (UEFI) specification states that PE is the standard executable format in EFI environments.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations that are often referred to by their own names. Almost all Windows programs interact with the Windows API. On the Windows NT line of operating systems, a small number use the Native API.

<span class="mw-page-title-main">MenuetOS</span>

MenuetOS is an operating system with a monolithic preemptive, real-time kernel written in FASM assembly language. The system also includes video drivers. It runs on 64-bit and 32-bit x86 architecture computers. Its author is Ville M. Turjanmaa. It has a graphical desktop, games, and networking abilities. One distinctive feature is that it fits on one 1.44 MB floppy disk. On an Intel Pentium MMX 200 MHz system, one person reported a boot time of "probably 5 seconds."

x86 assembly language is the name for the family of assembly languages which provide some level of backward compatibility with CPUs back to the Intel 8008 microprocessor, which was launched in April 1972. It is used to produce object code for the x86 class of processors.

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross compiler.

A high-level assembler in computing is an assembler for assembly language that incorporate features found in a high-level programming language.

An object file is a computer file containing object code, that is, machine code output of an assembler or compiler. The object code is usually relocatable, and not usually directly executable. There are various formats for object files, and the same machine code can be packaged in different object file formats. An object file may also work like a shared library.

.exe is a common filename extension denoting an executable file for Microsoft Windows, OS/2, and DOS.

High Level Assembly (HLA) is a language developed by Randall Hyde that allows the use of higher-level language constructs to aid both beginners and advanced assembly developers. It fully supports advanced data types and object-oriented programming. It uses a syntax loosely based on several high-level programming languages (HLLs), such as Pascal, Ada, Modula-2, and C++, to allow the creation of readable assembly language programs, and to allow HLL programmers to learn HLA as fast as possible.

Turbo Assembler is an assembler for software development published by Borland in 1989. It runs on and produces code for 16- or 32-bit x86 MS-DOS and compatible on Microsoft Windows. It can be used with Borland's other language products: Turbo Pascal, Turbo Basic, Turbo C, and Turbo C++. The Turbo Assembler package is bundled with Turbo Linker and is interoperable with Turbo Debugger.

The GNU Assembler, commonly known as gas or as, is the assembler developed by the GNU Project. It is the default back-end of GCC. It is used to assemble the GNU operating system and the Linux kernel, and various other software. It is a part of the GNU Binutils package.

The Microsoft Macro Assembler (MASM) is an x86 assembler that uses the Intel syntax for MS-DOS and Microsoft Windows. Beginning with MASM 8.0, there are two versions of the assembler: One for 16-bit & 32-bit assembly sources, and another (ML64) for 64-bit sources only.

In software engineering, retargeting is an attribute of software development tools that have been specifically designed to generate code for more than one computing platform.

On many computer operating systems, a computer process terminates its execution by making an exit system call. More generally, an exit in a multithreading environment means that a thread of execution has stopped running. For resource management, the operating system reclaims resources that were used by the process. The process is said to be a dead process after it terminates.

Open Watcom Assembler or WASM is an x86 assembler produced by Watcom, based on the Watcom Assembler found in Watcom C/C++ compiler and Watcom FORTRAN 77. Further development is being done on the 32- and 64-bit JWASM project, which more closely matches the syntax of Microsoft's assembler.

<span class="mw-page-title-main">KolibriOS</span> Operating system

KolibriOS, or Kolibri, is a small, open-source x86 operating system written completely in assembly. It was forked from MenuetOS in 2004 and has run under independent development since.

<span class="mw-page-title-main">SASM</span>

SASM is a free and open source cross-platform integrated development environment for the NASM, MASM, GAS and FASM assembly languages. It features syntax highlighting and includes a debugger.

References

  1. Error: Unable to display the reference properly. See the documentation for details.
  2. Grysztar, Tomasz (2008-05-12). "Flat Assembler Programmer's Manual". flat assembler. Retrieved 2008-05-12.
  3. 1 2 3 4 5 Hyde, Randall. "Which Assembler is the Best?" . Retrieved 2008-05-18.
  4. "FASMARM". 2008-03-20. Retrieved 2008-05-12.
  5. 1 2 "Interview with Privalov the author of FASM". 2004-08-12. Archived from the original on 2007-10-08. Retrieved 2008-05-12.
  6. Grysztar, Tomasz (2000-03-15). "flat assembler" . Retrieved 2008-05-19.
  7. 1 2 3 Grysztar, Tomasz. "Flat Assembler Design Principles" . Retrieved 2008-05-12.
  8. Grysztar, Tomasz. "FA – command line extension for fasm" . Retrieved 2012-05-11.
  9. 1 2 Found, John. "Fresh ID project".
  10. "MenuetOS" . Retrieved 2008-05-18.