A free and open source rewrite of the NASM assembler
Yasm supports x86 & AMD64 instruction sets, accepts NASM & GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 / 64-bit Mach-O, RDOFF2, COFF, Win32, and Win64 formats, and generates source debugging info in STABS, DWARF 2, and CodeView 8 formats.
- Nearly feature-complete lexing and parsing of NASM syntax.
- Basic support for TASM syntax?.
- Nearly feature-complete lexing and parsing of GAS (GNU assembler) syntax.
- AMD64 support (enabled using "BITS 64", "-m amd64", or selecting an explicitly 64-bit object format output such as "-f win64" or "-f elf64")
- 64-bit (and larger) integer constants allowed (including math operations).
- A fast jump size optimizer equivalent to or better than other assemblers' multi-pass optimizers.
- Support for multiple object formats: Binary object file output (NASM style), COFF object file? output, for use with DJGPP, Win32 object file? output, Win64/AMD64 aka "x64" object file? output, Supports structured exception handling, RDOFF2 object file? output, ELF32 and ELF64 object file output, 32 and 64-bit Mach-O object file? output.
- STABS, DWARF2, and CodeView? debug formats.
- Portability; currently compilable on: UNIX and compatibles (32-bit and 64-bit FreeBSD and Linux tested, GNU configure based autoconfiguration), DOS (using DJGPP), Windows (using Visual C++ or CygWin).
- Internationalization support via GNU gettext.
- Internal Features:
- A NASM syntax and GAS syntax recursive-descent parser.
- Architecture-specific instruction parsers hand-written for simplicity and size, as well as to make it easy to add additional architectures while retaining the same front-end syntax. The blend of recursive descent for syntax and a hand-written parser for instructions strikes a great balance between the strengths and weaknesses of each approach.
- A NASM syntax lexer written in re2c. A highly efficient scanner generator (almost always faster than lex/flex), it's also very embeddable due to its code generation methodology, allowing a number of re2c scanners to be used in various places in yasm without any worries about naming conflicts.
- A GAS syntax lexer written in re2c.
- Many of the modular interfaces at least superficially finished. This is still an area that needs a lot of work.
- A small set of portable equivalents of useful functions that are standard on some systems (detected via configure), such as the queue(3) set of functions, strdup, strcasecmp, and mergesort.
- A decent (and growing) set of assembler test input files to test the entire assembler as well as specific modules.
In a hurry? Add it to your Download Basket!
What's New in This Release:
- Add AMD TBM instructions.
- Add HSW TSX instructions.
- Fix “pmulhrw”, “vphaddudq”, and “vpbroadcastq” instructions.
- Add Intel SHA, ADX, RDSEED, and SMAP instructions.