FASM

From Wikipedia, the free encyclopedia

FASM
FASMD - DOS version with IDE
flat assembler
Developed by Tomasz Grysztar
Latest release 1.67.26 / January 28, 2008 (2008-01-28); 133 days ago
OS DOS (also IDE), Windows (also IDE), Linux, Unix (OpenBSD, etc.), MenuetOS, OctaOS, DexOS, SkyOS, SolarOS
Platform x86, x86-64
Genre Assembler
License Freeware / Open Source / BSD
Website http://flatassembler.net

FASM (Flat Assembler) is a free and open source Intel-style assembler supporting the IA-32 and x86-64 architectures. It is known for its fast speed, size optimizations, OS portability, and macro capabilities.[1][2] It is a low-level assembler[2] and uses few command-line options.

FASM contains bindings to the Windows GUI and OpenGL. All versions of FASM can directly output any of the following: flat "raw" binary (usable also as DOS COM executable or SYS driver), objects: ELF or COFF (classic or MS-specific), or executables in either MZ, ELF or PE format (including WDM drivers, allows custom MZ DOS stub). OMF objects, NE, LE, and LX executables are not natively supported by FASM (but see Agner Fog's OBJCONV). An unofficial port targeting the ARM architecture (FASMARM) also exists.[3]

Contents

[edit] History

The project was started in 1999 by Tomasz Grysztar, aka Privalov (at that time, an undergraduate student of mathematics from Poland) and its first public release was announced on March 15, 2000.[4][5] 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). It has been used to write several operating systems including MenuetOS[6], KolibriOS[7] and DexOS.[8]

[edit] Design

FASM is a low-level assembler. It does not support as many high-level statements as MASM or TASM.[2] Instead it provides syntax features and macros which make it possible to customize or create missing statements.[4] 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.[9]

FASM is a multi-pass assembler. It makes extensive code size optimization, and allows more forward referencing.[2][9] A usual FASM construct is defining data or 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 SSSO principle (same source, same output). This means the contents of the resulting file are not affected by the command line[9] (except recently (in 1.67.24) added "-D" switch). Such an approach saves FASM sources from compilation problems often present in many assembly projects. On the other hand, it makes it very hard to maintain a project that consists of multiple separately compiled source files, or mixed-language projects. FASM projects can be built from a single source directly into executable without a linking stage.[2]

[edit] Examples

  • DexOS, [1] & BOS - 32-bit DOS-like OS'es
  • MenuetOS, [2] - 32-bit and 64-bit GUI operating systems
  • KolibriOS, [3] 32-bit GUI OS
  • FASMLIB - portable library for x86 32-bit assembly programming
  • PROE - x86-64 encryption engine
  • RevaForth
  • uFMOD - .xm player for Win32, Linux, Unix/BSD and KolibriOS

Several compilers also use FASM as a backend:

[edit] See also

[edit] References

  1. ^ Tomasz Grysztar. Flat Assembler Programmer's Manual. Retrieved on 2008-05-12.
  2. ^ a b c d e Randall Hyde. Which Assembler is the Best?. Retrieved on 2008-05-18.
  3. ^ FASMARM (2008-03-20). Retrieved on 2008-05-12.
  4. ^ a b Interview with Privalov the author of FASM. Retrieved on 2008-05-12.
  5. ^ Tomasz Grysztar (2000-03-15). flat assembler. Retrieved on 2008-05-19.
  6. ^ MenuetOS. Retrieved on 2008-05-18.
  7. ^ KolibriOS. Retrieved on 2008-05-18.
  8. ^ "DexOS FAQ". Retrieved on 2008-05-18.
  9. ^ a b c Tomasz Grysztar. Flat Assembler Design Principles. Retrieved on 2008-05-12.

[edit] External links

  • FASMARM 1.11 - FASM for ARM processors 31-Aug-2007
  • FASMLIB 0.8.0 - portable 32-bit x86 asm lib for FASM/MASM/YASM/NASM
  • Fresh Alpha 1.1.4 - visual FASM IDE with built-in assembler for Win32 (discontinued)