Programowanie

FASM

FASM

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

FASM (Flat Assembler) is a free Intel-style assembler supporting the IA-32 and x86-64 architectures.

It is known for its fast speed, size optimizations, OS portability, and powerful macro capabilities. What should be noted is that FASM is very low-level assembler (unlike MASM), and uses almost no 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.

Contents

[edit] History

The project was started in 1999 by Tomasz Grysztar, aka Privalov (at that time, an undergraduate student of mathematics from Poland). FASM is completely written in assembly language, comes with full source, and has been able to assemble itself since version 0.90 (May 4, 1999). The first public release was announced on March 15, 2000.

[edit] Design

FASM is a very low-level assembler. It doesn't have many common high-level statements built-in (like if-else-endif, while, assume, invoke, ... etc. known from MASM); instead it provides syntax features to emulate some such statements using macros. This makes it possible to customize these statements, and create missing statements.

FASM is a multi-pass assembler. It makes extensive code size optimization, and allows more forward referencing. 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 (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. Most FASM projects are built from a single source directly into executable, without the linking stage.

[edit] Examples

Several compilers also use FASM as a backend:

[edit] See also

[edit] External links

Fresh Alpha 1.1.4 - visual FASM IDE with built-in assembler for Win32 (discontinued)