FASM
flat assembler |
|
| Developer(s) | Tomasz Grysztar |
|---|---|
| Stable release | 1.69.37 / February 13, 2012 |
| Operating system | DOS and IDE, Windows and IDE, Unix-like (Linux, OpenBSD, etc.), MenuetOS, KolibriOS, OctaOS,DexOS and IDE, SkyOS, Solar_OS |
| Platform | x86, x86-64 |
| Type | Assembler |
| License | Freeware/Open source/BSD |
| Website | flatassembler.net |
FASM (flat assembler) in computing is an assembler. It supports programming in 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.[1][2] It is a low-level assembler[2] and intentionally uses very few command-line options (see 'SSSO'). It is free and open source software.
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: 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). Complex or obscure output file formats, such as OMF, New Executable (NE), LE, and LX, are not natively supported by FASM (but see ObjConv). An unofficial port targeting the ARM architecture (FASMARM) also exists.[3]
Contents |
[edit] History
The project was started in 1999 by Tomasz Grysztar, a.k.a. Privalov, at that time, an undergraduate student of mathematics from Poland. Its was released publicly in March 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] and DexOS.[7]
[edit] Design
FASM originally only ran in 16-bit flat real mode. 32-bit support was added and then supplemented with optional DPMI support. It was written in a way that made it easy to port to any operating system that allowed flat 32-bit addressing; it was ported for Windows and then Linux.
FASM is a low-level assembler. It does not support as many high-level statements as MASM or TASM.[2] 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.[8]
FASM is a multi-pass assembler. It makes extensive code size optimization, and allows more forward referencing.[2][8] 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): the contents of the resulting file are not affected by the command line.[8] Such an approach saves FASM sources from compiling 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. However, the Win32 FA.EXE wrapper mitigates this somewhat. FASM projects can be built from one source file directly into an executable file without a linking stage.[2]
[edit] Examples
- DexOS,[9] BOS – 32-bit DOS-like OSes
- Derrick Operating System[10] – A 32-bit protected mode OS
- MenuetOS[11] – 32- and 64-bit GUI operating systems
- KolibriOS[12] – 32-bit GUI operating system
- Miraculix[13] – 32-bit GUI operating system
- PROE – x86-64 encryption engine
- RevaForth
- uFMOD – .xm player for Win32, Linux, Unix/BSD and KolibriOS
- +4_forever? – Commodore +4 Emulator
Several compilers use FASM as a backend:
[edit] See also
[edit] References
- ^ Tomasz Grysztar. "Flat Assembler Programmer's Manual". http://flatassembler.net/docs.php?article=manual. Retrieved 2008-05-12.
- ^ a b c d e Randall Hyde. "Which Assembler is the Best?". http://webster.cs.ucr.edu/AsmTools/WhichAsm.html. Retrieved 2008-05-18.
- ^ "FASMARM". 2008-03-20. http://arm.flatassembler.net/. Retrieved 2008-05-12.
- ^ a b "Interview with Privalov the author of FASM". http://www.wasm.ru/print.php?article=privalov_en. Retrieved 2008-05-12.
- ^ Tomasz Grysztar (2000-03-15). "flat assembler". http://marc.info/?l=freedos-dev&m=95311018003959&w=2. Retrieved 2008-05-19.
- ^ "MenuetOS". http://www.menuetos.net/. Retrieved 2008-05-18.
- ^ "DexOS FAQ". http://www.dex-os.com/old/faq.htm. Retrieved 2008-05-18.
- ^ a b c Tomasz Grysztar. "Flat Assembler Design Principles". http://flatassembler.net/docs.php?article=design. Retrieved 2008-05-12.
- ^ www.dex-os.com
- ^ www.osderrick.tk
- ^ www.menuetos.net
- ^ www.kolibrios.org
- ^ kreoton.com
[edit] External links
- FASM project: Official website, official manual, examples, message board, archive of older versions
- #flatassembler – IRC channel
- FASMARM – FASM for ARM processors, v1.24, October 29, 2011
- FASMLIB 0.8.0 – portable 32-bit x86 asm lib for FASM/MASM/YASM/NASM/GASM
|
|||||||||||