FASM

From Wikipedia, the free encyclopedia

FASM
FASMD - DOS version with IDE
Developer: Tomasz Grysztar
Latest release: 1.67.21 / 11 March 2007
OS: DOS (also IDE), Windows (also IDE), Linux, Unix (OpenBSD, etc.), MenuetOS, OctaOS, DexOS, SkyOS, DOSBox, SolarOS (work in progress)
Use: Assembler
License: Freeware / Open Source / BSD
Website: flatassembler.net

FASM (Flat Assembler) is a free, multiple-pass, Intel-style assembler supporting the IA-32 and x86-64 architectures. 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. It is famous for its fast speed, size optimizations, OS portability, and powerful macro capabilities. What should be noted is that FASM is different from MASM (by intention, supposed to be better) and uses almost no command-line options (due to the SSSO principle: same source, same output).

FASM contains bindings to the Windows GUI and OpenGL. All versions of FASM can directly output any of the following: flat binary, objects: ELF or COFF (classic or MS), or executables in either MZ, ELF or PE format (and can optionally change the default MZ DOS stub). But OMF objects, NE, LE, and LX executables are not natively supported by FASM. An unofficial port targeting the ARM architecture (FASMARM) also exists (thanks to revolution).

Contents

[edit] Examples

Besides DexOS, KolibriOS and MenuetOS, there are various useful source code samples usually found through the online forum (BOS, NanoOS, DebugOS, TetrOS, FASMLIB, PROE, RevaForth, Stega, uFMOD, FDBG, Snake, Procbench, Alarm, AsmRegEx, rc-converter, Mini Sudoku, httpd, LDE, 15puz, para512, analog clock, various tiny demos, etc).

Several compilers also use FASM as a backend (PureBasic, BlitzMax, HLA, Context/Win32, B0).

[edit] Tips

  • The DOS version of FASM uses unreal mode or DPMI, FASMD uses DPMI only and therefore requires a DPMI host (HDPMI32 or CWSDPMI).
  • To use in DOSBox, run CWSDPMI.EXE of DJGPP immediately before FASM.EXE.
  • The Win32 console version can be reassembled via source found in the DOS port (and vice versa).
  • Set INCLUDE=C:\FASMW\INCLUDE under [Environment] in your FASMW.INI to avoid setting your environment variables manually (to more easily reassemble files which e.g. include "win32axp.inc").

[edit] Other assemblers

[edit] See also

[edit] External links