GNU Assembler

GNU Assembler
Developer(s)GNU Project
Stable release
GNU Binutils 2.43.1[1] Edit this on Wikidata / 17 August 2024; 40 days ago (17 August 2024)
Written inC
PlatformCross-platform
TypeAssembler
LicenseGNU General Public License v3
Websitewww.gnu.org/software/binutils/

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

The GAS executable is named as, the standard name for a Unix assembler. GAS is cross-platform, and both runs on and assembles for a number of different computer architectures. GAS is free software released under the GNU General Public License v3.

History

The first version of GAS was released in 1986–1987.[2] It was written by Dean Elsner and supported the VAX architecture.[2]

General syntax

GAS supports a general syntax that works for all of the supported architectures. The general syntax includes assembler directives and a method for commenting. The default syntax is AT&T syntax.

Directives

GAS 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.[3]

Since version 2.10, Intel syntax can be used through use of the .intel_syntax directive.[4][5][6]

Comments

GAS supports two comment styles.[7]

Multi-line

As in C, multi-line comments start and end with mirroring slash-asterisk pairs:

/* 
comment
*/

Single-line

Single line comments have a few different formats varying on which architecture is being assembled for.

Usage

Being the back-end for a popular compiler suite, namely GCC, the GNU Assembler is very widely used in compiling modern free and open source software. GAS is often used as the assembler on Linux operating systems in conjunction with other GNU software. A modified version of GAS can also be found in the macOS development tools package since OS X.

Example program

A standard "Hello, world!" program for Linux on IA-32:

.global	_start

.text
_start:
	movl  $4, %eax   # 4 (code for "write" syscall) -> EAX register
	movl  $1, %ebx   # 1 (file descriptor for stdout) -> EBX (1st argument to syscall)
	movl  $msg, %ecx # 32-bit address of msg string -> ECX (2nd argument)
	movl  $len, %edx # length of msg string -> EDX (3rd arg)
	int   $0x80      # interrupt with location 0x80 (128), which invokes the kernel's system call procedure

	movl  $1, %eax   # 1 ("exit") -> EAX
	movl  $0, %ebx   # 0 (with success) -> EBX
	int   $0x80      # see previous
.data
msg:
	.ascii  "Hello, world!\n" # inline ascii string
	len =   . - msg           # assign (current address - address of msg start) to symbol "len"

See also

References

  1. ^ Nick Clifton (17 August 2024). "GNU Binutils 2.43.1 released". Retrieved 18 August 2024.
  2. ^ a b "The GNU Assembler". CiteSeerX 10.1.1.32.4503.
  3. ^ "The GNU Assembler - Assembler Directives". Archived from the original on 2012-02-22. Retrieved 2008-04-13.
  4. ^ "GNU Assembler News". A new pseudo-op .intel_syntax has been implemented to allow gas to parse i386 assembly programs with intel syntax.
  5. ^ "AT&T Syntax versus Intel Syntax". Archived from the original on 20 June 2011. Retrieved 28 July 2014.
  6. ^ Ram Narayan (2007-10-17). "Linux assemblers: A comparison of GAS and NASM". IBM DeveloperWorks. Archived from the original on 3 March 2009. Retrieved 28 July 2014.
  7. ^ Red Hat Inc. "Using as". Archived from the original on June 20, 2011. Retrieved Jan 10, 2013.

Read other articles:

Czech actress This biography of a living person needs additional citations for verification. Please help by adding reliable sources. Contentious material about living persons that is unsourced or poorly sourced must be removed immediately from the article and its talk page, especially if potentially libelous.Find sources: Klára Issová – news · newspapers · books · scholar · JSTOR (July 2011) (Learn how and when to remove this template message) Klara ...

«Take Me Out to the Ball Game» Canción de Edward MeekerÁlbum seventh-inning stretch y Songs of the CenturyPublicación 1908Género ValsDuración 74 segundosCompositor Albert von TilzerLetrista Jack NorworthIdioma original inglésPaís de origen Estados Unidos[editar datos en Wikidata] Take Me Out to the Ball Game es una canción de 1908 escrita por Jack Norworth y musicalizada por Albert von Tilzer. Es la melodía más popular en el mundo del béisbol de los Estados Unidos. La g...

Muhammad Amin SalehKadiv TI PolriMasa jabatan23 Februari 2012 – 12 Juni 2013PendahuluIrjen. Pol. Robert AritonangPenggantiIrjen. Pol. Tubagus Anis AngkawijayaGubernur AkpolMasa jabatan5 Mei 2011 – 23 Februari 2012PendahuluIrjen. Pol. Boedhi Santoso MoestaryPenggantiIrjen. Pol. Djoko SusiloWakil Kepala Badan Pemelihara Keamanan PolriMasa jabatan15 Desember 2010 – 5 Mei 2011PendahuluIrjen. Pol. PrasetyoPenggantiIrjen. Pol. Bambang SuparnoKepala Kepolisian Daerah...

Glencoe, escenario de la masacre de 1692. La Masacre de Glencoe ocurrió en Glen Coe, Escocia, en la madrugada del 13 de febrero de 1692, durante la era de la Revolución Gloriosa y del Jacobismo. La masacre comenzó simultáneamente en tres emplazamientos —Invercoe, Inverrigan y Achacon— aunque la matanza tuvo lugar en toda la zona durante la persecución de los MacDonald. En total, 38 MacDonald, del clan MacDonald de Glencoe fueron asesinados por los invitados que habían aceptado su ho...

Dalam nama Korea ini, nama keluarganya adalah So. So Chae-wonFinal Piala Dunia Panahan 2019 di Moskwa.Informasi pribadiKewarganegaraanKoreaLahir12 November 1997 (umur 26) Nama KoreaHangul소채원 Alih AksaraSo ChaewonMcCune–ReischauerSo Ch'aewŏnOlahragaNegara Korea SelatanOlahragaPanahan Rekam medali Mewakili  Korea Selatan Pesta Olahraga Asia 2018 Jakarta–Palembang Tim putri 2018 Jakarta-Palembang Tim campuran Kejuaraan Panahan Dunia 2017 Mexico City Tim putri Piala Duni...

Das Dekanat St. Georgen ist ein Dekanat der römisch-katholischen Erzdiözese Salzburg. Inhaltsverzeichnis 1 Pfarren mit Kirchengebäuden 2 Dekanat St. Georgen 3 Dechanten 4 Weblinks 5 Einzelnachweise Pfarren mit Kirchengebäuden Ort Pfarrverband Ink. Seit Patrozinium Kirchengebäude Bild Anthering Anthering – Maria Bühel – Nußdorf am Haunsberg – Oberndorf bei Salzburg 1857 Mariä Himmelfahrt Pfarrkirche Anthering Bürmoos Bürmoos – Dorfbeuern – Lamprechtshausen – St. Georgen b...

مايكل كونستانتين (بالإنجليزية: Michael Constantine)‏  معلومات شخصية اسم الولادة (باليونانية: Gus Efstratiou)‏  الميلاد 22 مايو 1927(1927-05-22)ريدينغ، الولايات المتحدة الوفاة 31/08/2021ريدينغ مواطنة الولايات المتحدة  عدد الأولاد 2   الحياة العملية المهنة ممثل اللغة الأم الإنجليزية  اللغ...

Swedish wrestler Gustav FreijGustav Freij in 1952Personal informationBorn17 March 1922Malmö, SwedenDied4 August 1973 (aged 51)Malmö, SwedenHeight1.70 m (5 ft 7 in)Weight67 kg (148 lb)SportSportGreco-Roman wrestlingClubIK Sparta, Malmö Medal record Representing  Sweden Olympic Games 1948 London Lightweight 1952 Helsinki Lightweight 1960 Rome Lightweight World Wrestling Championships 1950 Stockholm -67 kg 1953 Naples -67 kg 1955 Karlsruhe -67 kg Karl Gustav Herb...

Pemandangan stadion kuil Delfi, yang dipakai untuk Pesta Olahraga Pitia. Pesta Olahraga Pitia (Yunani: Πύθια; juga Pesta Olahraga Delfi) adalah salah satu dari empat Pesta Olahraga Panhellenik dari Yunani Kuno. Acara tersebut diadakan untuk menghormati Apollo setiap empat tahun di sebuah kuil yang terletak di Delfi.[1] Referensi ^ Pythian Games, Encyclopædia Britannica. Pranala luar Wikimedia Commons memiliki media mengenai Pythian Games. Michael Scott. Delphi: The Bellybutton o...

Saudi Arabian long-distance runner You can help expand this article with text translated from the corresponding article in German. (August 2019) Click [show] for important translation instructions. View a machine-translated version of the German article. Machine translation, like DeepL or Google Translate, is a useful starting point for translations, but translators must revise errors as necessary and confirm that the translation is accurate, rather than simply copy-pasting machine-trans...

Irish musician This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Ciarán Bourke – news · newspapers · books · scholar · JSTOR (October 2017) (Learn how and when to remove this template message) Ciarán BourkeBackground informationBorn18 February 1935Dublin, IrelandDied10 May 1988 (aged 53)Dublin, IrelandGenres...

Pelvis Datos generalesOrigen Buenos AiresEstado ActivoInformación artísticaGénero(s) RockabillyRock and rollPeríodo de actividad 1985 - 19932000 - 2001 - 2014Discográfica(s) Excalibur, Phillips, UmbralArtistas relacionados Elvis Presley Stray Cats Gene Vincent SandroMiembros Ronny Bar, Loquillo Armoza, Hernan Vatt,Exmiembros Danny Burton * Formación original[editar datos en Wikidata] Pelvis es un grupo musical argentino del género rockabilly y rock and roll surgido ...

1978 novel by Patrick O'Brian For other uses, see Desolation Island. Desolation Island Cover of the first editionAuthorPatrick O'BrianCountryUnited KingdomLanguageEnglishSeriesAubrey–Maturin seriesGenreHistorical novelPublisherCollins (UK)Stein & Day (US)Publication date1978Media typePrint (Hardback & Paperback)Pages276ISBN0-00-222145-4 First edition hardbackOCLC44024595Preceded byThe Mauritius Command Followed byThe Fortune of War  Desolation Island is the ...

Failed conspiracy to overthrow the British government (1721–22) Francis Atterbury by Kneller vteJacobite risings 1689 War in Ireland 1696 1708 1715 1719 1721 1744 1745 1759 The Atterbury Plot was a conspiracy led by Francis Atterbury, Bishop of Rochester and Dean of Westminster, aimed at the restoration of the House of Stuart to the throne of Great Britain. It came some years after the unsuccessful Jacobite rising of 1715 and Jacobite rising of 1719, at a time when the Whig government of th...

ديك براون معلومات شخصية الميلاد 9 مايو 1926  كليفلاند، أوهايو  الوفاة 20 مايو 2000 (74 سنة)   غويلف  مواطنة الولايات المتحدة  الحياة العملية المدرسة الأم جامعة تورنتو  المهنة لاعب كرة قدم كندية  الرياضة كرة القدم الكندية  تعديل مصدري - تعديل   ديك براون (بالإن...

Color space used in video electronics YPbPr is the analog video signal carried by component video cable in consumer electronics. The green cable carries Y, the blue cable carries PB and the red cable carries PR. YPbPr or Y'PbPr, also written as YPBPR, is a color space used in video electronics, in particular in reference to component video cables. Like YCbCr, it is based on gamma corrected RGB primaries; the two are numerically equivalent but YPBPR is designed for use in analog systems while ...

ШКАС Крыльевой вариант пулемёта ШКАС (перевёрнут) Тип авиационный пулемёт Страна  СССР История службы На вооружении  СССР→ Испания Монголия Китай Китайская Республика КНДР Войны и конфликты Гражданская война в Испании,Бои на Халхин-Голе,Зимняя война,...

Battle between British Indian Army and Emperor Tewodros II of Ethiopia in 1868 This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Battle of Magdala – news · newspapers · books · scholar · JSTOR (April 2013) (Learn how and when to remove this template message) Battle of MagdalaPart of the 1868 Expedition to Abys...

Obasanjo, 2014 Obasanjo, 1978 Obasanjo mit US-Präsident George W. Bush in Frankreich am 1. Juni 2003 Obasanjo, Brasília, September 2005 Olusegun Obasanjo (Yoruba Oluṣẹgun Mathew Okikiọla Arẹmu Ọbasanjọ, * 5. März 1937 in Abeokuta, Nigeria) war von 1976 bis 1979 und von 1999 bis 2007 Staatspräsident von Nigeria. Inhaltsverzeichnis 1 Leben 2 Ehrungen 3 Literatur 4 Weblinks 5 Einzelnachweise Leben Obasanjo gehört dem Volk der Yoruba an, ist baptistischer Christ und trat 1958 in ...

Sede Unioncamere a Roma, Piazza Sallustio, Horti Sallustiani. Camera di commercio di Bologna presso la Loggia dei Mercanti. Camera di commercio di Messina. Camera di commercio di Ferrara. Camera di commercio di Pescara. Camera di Commercio di Catania. Camera di Commercio di Reggio Calabria presso il Palazzo della Camera di commercio. Camera di commercio di Benevento presso il Palazzo della Camera di commercio. Camera di commercio di Trieste. Camera di commercio di Livorno, presso il Palazzo d...