Yasm 0.5.0 review

Download
by rbytes.net on

Yasm is a complete rewrite of the NASM assembler under the "new" BSD License (some portions are under other licenses, see COPYING for

License: BSD License
File size: 1144K
Developer: Peter Johnson
0 stars award from rbytes.net

Yasm is a complete rewrite of the NASM assembler under the "new" BSD License (some portions are under other licenses, see COPYING for details).

Yasm project is designed from the ground up to allow for multiple assembler syntaxes to be supported (eg, TASM, GAS, NASM etc.) in addition to multiple output object formats and even multiple instruction sets. Another primary module of the overall design is an optimizer module.

The core focus of Yasm is not the "yasm" commandline frontend; rather, it is the Libyasm library and associated LoadableModules? (see the ProgrammerReferences for documentation).

Libyasm and the modules are intended for reuse in other sorts of programs dealing with code at the assembly level (compilers, debuggers, etc). Someday, libyasm may be packaged separately from the rest of Yasm.

Key Current User-Visible Features of "Yasm":
Nearly feature-complete lexing and parsing of (preprocessed) NASM syntax?.
AMD64 support (enabled using "BITS 64" and "-m amd64" option)
64-bit (and larger) integer constants allowed (including math operations).
Internationalization support via GNU gettext.
A simple 2-pass optimizer (it's a bit better than the NASM one).
The "real" NASM preprocessor (imported from NASM's source tree).
Binary object file? output (NASM style).
COFF object file? output, for use with DJGPP.
Win32 object file? output (including Win64/AMD64 support).
STABS debug format?.
ELF32 and ELF64 object file output. No debugging information included at this point.
Portability; currently compilable on:
UNIX and compatibles (FreeBSD and Linux tested, GNU configure based autoconfiguration)
DOS (using DJGPP)
Windows (using Visual C++ or CygWin).

Key Internal Features of "Yasm":
A NASM syntax parser written in yacc. This simplifies the source code and increases performance: yacc-generated parsers are almost always faster than hand-written ones. Also, yacc (and its GNU implementation, bison) is an extremely well-tested and well-documented tool.
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 yacc 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.
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 equivalants 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.

Important Differences from NASM:

Yasm defaults to reading from standard input if no files are specified. When an input file is specified, Yasm behaves like NASM.
A number of command line options are different. Run "yasm --help" for a quick command line option summary, or read the full yasm(1) manpage for detailed descriptions of all command line options.

What's New in This Release:
Major changes since the last release candidate include support for arithmetic on single-character constants, support for OUTPUT_FORMAT as an alias for YASM_OBJFMT, and other bugfixes.
Changes since the last major release include support for GAS syntax, support for CodeView and DWARF2 debug formats, and a changed -I search pattern.

Yasm 0.5.0 search tags