Share on Facebook Share on Twitter Email
Answers.com

GNU Assembler

 
Wikipedia: GNU Assembler
GNU Assembler
Stable release 2.20 / 2009-10-19; 2 months ago
Platform Cross-platform
Website http://www.gnu.org/software/binutils/

The GNU Assembler, commonly known as Gas, is the assembler used by the GNU Project. It is the default back-end of gcc. It is used to compile the GNU operating system and the Linux kernel, and various other software. It is a part of the GNU Binutils package.

Gas's executable is named after as, a Unix assembler. Gas is cross-platform, and both runs on and assembles for a number of different computer architectures. Released under the GNU General Public License, Gas is free software.

Contents

General syntax

The GNU Assembler has a general syntax that works for all of the supported architectures. The general syntax includes assembler directives and a method for commenting.

Assembler directives

The GNU Assembler uses assembler directives (also known as pseudo ops), which are keywords beginning with a period that behave similarly to preprocessor directives in the C programming language. While most of the available assembler directives are valid regardless of the target architecture, some directives are machine dependent.[1]

Comments

Similar to the C programming language is Gas's implementation of multiline comments which uses /* to begin a comment and */ to end a comment.[2]

For example:

    movl %eax,%edx /* this is a comment sandwich,
                      it is made of description
                      and linebreak */

Gas uses the # symbol for a single-line comment.

For example:

    pop  %edx # this is a comment
# as well as this
    movl %edx,%eax

Criticisms

One source of criticism is the fact that on the x86 and x86-64 architecture it uses the AT&T assembler syntax, rather than the Intel syntax used in many other assemblers; however, since version 2.10[3], support for the Intel syntax via the .intel_syntax directive has been added.[4][5]

See also

References

External links


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
 
 
Learn More
As (Unix)
Cygnus Solutions
Toshiba TLCS

What Does a Gnu's Eat? Read answer...
Is a gnu an animal? Read answer...
What is the GNU software? Read answer...

Help us answer these
The meaning of GNU?
What is the plural of gnu?
Does a Gnu have a backbone?

Post a question - any question - to the WikiAnswers community:

 

Copyrights:

Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "GNU Assembler" Read more