Skip to content
Michael Urman edited this page Jul 9, 2020 · 4 revisions

Frequently Asked Questions

Q1: Why do I want to use Yasm?

A1: The main reason might be some of the features listed on the front page. We've found that many people are attracted by features such as support for Structured Exception Handling on Win64 and AMD64 64-bit assembly in general, support for both NASM and GAS assembler syntaxes, wide object format support, and portability of the assembler itself.

Other reasons you might like to use Yasm:

  • For ideological (licensing) reasons; Yasm is mostly BSD-licensed.
  • For its future potential. Yasm's architecture makes it likely that future versions of Yasm will incorporate additional object formats, additional parsers (Yasm already has GAS and NASM syntax support), and additional architectures.
  • For its user-centric design approach. We're always interested in Yasm having all the features its users need (speed included) than merely being "better than the other guy," so tell us what else you need for Yasm to be your assembler.

Q2: Is YASM an abbreviation? For instance NASM is an abbreviation for netwide assembler.

A2: This is a very important question. Without the correct answer, entire cities of people may not be able to sleep at night. To avert this disaster, here are some potential expansions that yasm might abbreviate:

  • Yes, it's an assembler
  • Your favorite assembler
  • Yet another assembler
  • Why an assembler? However none of these are a clear winner. Maybe it's just Yasm, the modular assembler.

Q3: Has YASM use been evident in the community as yet? Can you show any projects that have used YASM?

A3: Its primary mention in the community is in the Linux Assembly HOWTO (section 3.5.1). Major interested groups are those who want NASM syntax combined with AMD64 support. This includes XviD and x264 amongst others.

Q4: Is it compatible with NASM at source level by default?

A4: By design and intent, you should be able to use Yasm to assemble ''almost'' any source file you can assemble with NASM. There are some limitations and the occasional bug. If you encounter them, please check the Bug Tracker and open a new ticket if necessary.

Q5: What makes YASM better then NASM or FASM?

A5: We like it. We hope you'll like it too.

Q6: Why write an Assembler in C!?

A6: For maintainability, it's better to use a high-level language in commonly used code, since more people know those high-level languages and will be better able to understand and modify it properly. Also, combined with a C compiler that requires it it's symbiotically self-compiling.

By writing Yasm in C, we can more easily support cross-assembling any supported output platform on any platform that supports the C we use. We see no reason to constrain ourselves to assembly when assembly is not the best choice for our goals, and here we felt that C was a better choice.

Q7: Does yasm contain a disassembler?

A7: Not at present; see #50. The diStorm64 project has BSD-licensed source code available for an AMD64 disassembler.

Q8: Why doesn't Yasm error out on invalid or typoed opcodes like innt3?

A8: A quirk of the NASM compatible syntax is single identifiers on a line that aren't registers or instructions become labels. You can track these down easily by adding -Worphan-labels to your command line.

% echo 'innt3' | yasm -pnasm -Worphan-labels
-:1: warning: label alone on a line without a colon might be in error

Q9: How can I get YASM to work with MSVC++ 2005 without dealing with the command line or .bat files?

A9: See VisualStudio2005.

Q10: How do I start Yasm?

A10: Yasm is a command-line program. You run it as "yasm ..." from the command line or batch file (see the documentation for the various command line options). Alternatively, see the previous question for Visual Studio integration.

Q11: Does YASM have a "nasm2gas" function?

A11: Yasm will happily parse both NASM and GAS code as input. It currently does not have the ability to output assembly code in any format.

Q12: Which debugging format is better? stabs or dwarf2?

A12: dwarf2 by far. Almost all modern Unixy systems use dwarf2 instead of STABS due to significantly better C++ support in DWARF2. Yasm supports STABS output for the rare systems that still use it. Typically debuggers are only built with support for one format, so if one doesn't work, try the other. Note that Windows targets should be using the cv8 debug format instead.

Q13: YASM support other hardware platform? (For example, Blackfin, Tilera, MMIX ...)

A13: As of today, the only other supported instruction set architecture is LC-3b, used in the textbook "Introduction to Computing Systems: From Bits and Gates to C and Beyond". The infrastructure is there to support other architectures (such as PPC or the ones you mention), but no one has yet implemented them in Yasm.