넷와이드 어셈블러

넷와이드 어셈블러
원저자Simon Tatham, 줄리안 홀
개발자H. Peter Anvin
안정화 버전
2.13.03 / 2018년 2월 20일(6년 전)(2018-02-20)
저장소
운영 체제윈도우, 유닉스 계열, OS/2, OS X, 도스
언어영어
종류x86 어셈블러
라이선스BSD 2-clause
웹사이트www.nasm.us

넷와이드 어셈블러(Netwide Assembler, NASM)은 인텔 x86 아키텍처용 어셈블러이자 역어셈블러이다. 16비트, 32비트(IA-32), 64비트(x86-64) 프로그램 작성에 사용할 수 있다. NASM은 가장 대중적인 리눅스용 어셈블러들 가운데 하나로 인식된다.[1]

NASM은 원래 줄리안 홀(Julian Hall)의 도움을 받아 Simon Tatham에 의해 작성되었다. 2016년 기준으로, H. Peter Anvin이 주도하는 조그마한 팀에 의해 유지보수되고 있다.[2] 단순화된 (2-clause) BSD 라이선스 조항에 의거하여 출시되는 오픈 소스 소프트웨어이다.[3]

운영 체제별 프로그램의 예

아래는 도스용 운영 체제를 위한 헬로 월드 프로그램이다.

section .text
org 0x100
	mov	ah, 0x9
	mov	dx, hello
	int	0x21

	mov	ax, 0x4c00
	int	0x21

section .data
hello:	db 'Hello, world!', 13, 10, '$'

비슷한 프로그램으로 마이크로소프트 윈도우용의 예는 다음과 같다:

global _main
extern _MessageBoxA@16
extern _ExitProcess@4

section code use32 class=code
_main:
	push	dword 0 ; UINT uType = MB_OK
	push	dword title ; LPCSTR lpCaption
	push	dword banner ; LPCSTR lpText
	push	dword 0 ; HWND hWnd = NULL
	call	_MessageBoxA@16

	push	dword 0 ; UINT uExitCode
	call	_ExitProcess@4

section data use32 class=data
	banner:	db 'Hello, world!', 0
	title:	db 'Hello', 0

리눅스용으로는 다음과 같다:

global _start

section .text
_start:
	mov	eax, 4 ; write
	mov	ebx, 1 ; stdout
	mov	ecx, msg
	mov	edx, msg.len
	int	0x80 ; write(stdout, msg, strlen(msg));

	mov	eax, 1 ; exit
	mov	ebx, 0
	int	0x80 ; exit(0)

section .data
msg:	db	"Hello, world!", 10
.len:	equ	$ - msg

아래는 애플 OS X용 64비트 프로그램의 하나로, 키 입력을 받아 화면에 표시하는 부분이다

global _start

section .data

	query_string:		db	"Enter a character: "
	query_string_len:	equ	$ - query_string
	out_string:			db	"You have input: "
	out_string_len:		equ	$ - out_string

section .bss

	in_char:			resw 4

section .text

_start:

	mov	rax, 0x2000004 	; put the write-system-call-code into register rax
	mov	rdi, 1				; tell kernel to use stdout
	mov	rsi, query_string	; rsi is where the kernel expects to find the address of the message
	mov	rdx, query_string_len	; and rdx is where the kernel expects to find the length of the message
	syscall

	; read in the character
	mov	rax, 0x2000003		; read system call
	mov	rdi, 0				; stdin
	mov	rsi, in_char		; address for storage, declared in section .bss
	mov	rdx, 2				; get 2 bytes from the kernel's buffer (one for the carriage return)
	syscall

	; show user the output
	mov	rax, 0x2000004		; write system call
	mov	rdi, 1				; stdout
	mov	rsi, out_string
	mov	rdx, out_string_len
	syscall

	mov	rax, 0x2000004		; write system call
	mov	rdi, 1				; stdout
	mov	rsi, in_char
	mov	rdx, 2				; the second byte is to apply the carriage return expected in the string
	syscall

	; exit system call
	mov	rax, 0x2000001		; exit system call
        xor     rdi, rdi
	syscall

개발

2007년 11월 28일, 버전 2.00이 출시되었으며 x86-64 확장 지원을 추가하였다.[2] 개발 버전들은 소스포지에 업로드되지 않지만, 프로젝트 웹 페이지에서 이용 가능한 바이너리 스냅샷을 포함하여 프로젝트 자체의 Git 저장소에서 검진된다.

NASM 문서의 검색 엔진 또한 이용이 가능하다.[4]

2.07 버전의 NASM은 단순화된 (2-clause) BSD 라이선스 하에서 배포된다.

RDOFF

RDOFF(Relocatable Dynamic Object File Format)는 개발자들이 NASM의 오브젝트 파일 출력 속성을 테스트하는 목적으로 사용된다. 상당 부분 NASM의 내부 구조에 기반을 두고 있으며[5] 필수적으로 출력 드라이버 함수 호출과 실행 가능한 코드나 데이터를 포함하는 섹션 배열의 직렬화를 포함하는 헤더로 이루어져 있다. 링커와 로더를 포함한, 이 포맷을 사용하는 도구들은 NASM 배포판에 포함되어 있다.

같이 보기

각주

  1. Ram Narayan. “Linux assemblers: A comparison of GAS and NASM”. 2013년 10월 3일에 원본 문서에서 보존된 문서. two of the most popular assemblers for Linux, GNU Assembler (GAS) and Netwide Assembler (NASM) 
  2. “The Netwide Assembler”. 2008년 6월 27일에 확인함. 
  3. “NASM Version History”. 2009년 7월 19일에 확인함. 
  4. “NASM Doc Search Engine”. 2010년 1월 23일에 원본 문서에서 보존된 문서. 2009년 9월 14일에 확인함. 
  5. “NASM Manual Ch. 6”. 2008년 6월 27일에 확인함. 

참고 문헌

외부 링크

Read other articles:

Badan Meteorologi, Klimatologi, dan Geofisika BMKGGambaran umumDasar hukumUU Nomor 31 Tahun 2009Bidang tugasMeteorologi, klimatologi, kualitas udara dan geofisikaSloganCepat, Tepat, Akurat, Luas dan Mudah dipahamiPegawai4833 Pegawai PNS (Oktober 2021)[1]KepalaProf. Ir. Dwikorita Karnawati, M.Sc, Ph.DSekretaris UtamaIr. Dwi Budi Sutrisno, M.ScDeputiDeputi Bidang Meteorologi BMKGGuswanto, M.SiDeputi Bidang Klimatologi BMKGDr. Ir. Dodo Gunawan, DEADeputi Bidang Geofisika BMKGDr. Suk...

 

Ashish SharmaLahirAshish Sharma30 Agustus 1984 (umur 39)Jaipur, Rajasthan, IndiaKebangsaanIndianPekerjaanAktorTahun aktif2009–sekarangSuami/istriArchana Taide (Januari 2013 - sekarang) Ashish Sharma adalah seorang aktor film dan televisi India. Dia dikenal karena perannya sebagai Lord Ram[1] di acara TV Siya Ke Ram, sebagai Mayor Rudra Pratap Ranawat di acara TV Rangrasiya dan sebagai Chandragupta Maurya di acara TV Chandragupta Maurya di NDTV-Imagine TV. Karier Ashish Sh...

 

British film trade newspaper Cover of Kine Weekly, 3 March 1966 Kinematograph Weekly, popularly known as Kine Weekly, was a trade paper catering to the British film industry between 1889 and 1971. History Kinematograph Weekly was founded in 1889 as the monthly publication Optical Magic Lantern and Photographic Enlarger. In 1907 it was renamed Kinematograph Weekly, containing trade news, advertisements, reviews, exhibition advice, and reports of regional and national meetings of trade organisa...

هذه مقالة غير مراجعة. ينبغي أن يزال هذا القالب بعد أن يراجعها محرر؛ إذا لزم الأمر فيجب أن توسم المقالة بقوالب الصيانة المناسبة. يمكن أيضاً تقديم طلب لمراجعة المقالة في الصفحة المخصصة لذلك. (أكتوبر 2019) هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة �...

 

Pour les articles homonymes, voir Ancien 5e arrondissement de Paris et 5e arrondissement. 5e arrondissement de Paris « arrondissement du Panthéon » Le Panthéon. Administration Pays France Ville Paris Quartiers administratifs Saint-Victor (17)Jardin-des-Plantes (18)Val-de-Grâce (19)Sorbonne (20) Maire Mandat Florence Berthout depuis 2014 Code postal 75005 Code Insee 75105 Démographie Population 56 841 hab. (2021 ) Densité 22 378 hab./km2 Géographie C...

 

Australian media conglomerate News Corp AustraliaCompany typeSubsidiaryIndustryMass mediaPredecessorNews LimitedFounded1923; 101 years ago (1923), in Adelaide, South AustraliaFounderJames Edward DavidsonHeadquartersSurry Hills, Sydney, AustraliaArea servedAustraliaKey peopleMichael Miller (executive chairman)ProductsNewspapersMagazinesInternetServicesPay televisionNational Rugby LeagueMarket researchDVD and film distributionFilm and television productionParentNews CorpSubsid...

Cet article est une ébauche concernant Los Angeles. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Pacoima Administration Pays États-Unis Ville Los Angeles (comté de Los Angeles, Californie) Démographie Population 81 318 hab. Densité 11 389 hab./km2 Géographie Coordonnées 34° 15′ 54″ nord, 118° 25′ 08″ ouest Superficie 714 ha ...

 

Bahasa Bantoanon Asi Dituturkan di  Filipina WilayahRomblonPenutur150.000 jiwa[1] Rincian data penutur Jumlah penutur beserta (jika ada) metode pengambilan, jenis, tanggal, dan tempat.[2] 150.000 (Bahasa ibu) Rumpun bahasaAustronesia Melayu-PolinesiaFilipinaFilipina Tengah RayaFilipina TengahBisayaBantoanon DialekBantoanon Odionganon Calatravanhon Sibalenhon Simaranhon Sistem penulisanAlfabet LatinBaybayin (dikenal sebagai Suyat)Kode bahasaISO 639-3bnoGlottologbant12...

 

Indonesian actor (born 1982) Abimana AryasatyaAbimana on interview with Media Indonesia, 2019BornRobertino (1982-10-24) 24 October 1982 (age 41)Jakarta, IndonesiaOccupations Actor film producer Years active1995–presentsSpouse Inong Nindya Ayu ​(m. 2001)​ChildrenBelva UgrahaSatine Zaneta Putri HujanBima BijakArsanadi SarkaParent(s)Roberto Candelas Aguinaga[1]Ie Siu Khiauw[2] Abimana Aryasatya (born Robertino; 24 October 1982) is an Indon...

Bursa Karagöz MuseumBursa Karagöz MüzesiLocation within MarmaraEstablished2007; 17 years ago (2007)LocationÇekirge St., Çekirge, Osmangazi, Bursa, TurkeyCoordinates40°12′07″N 29°01′38″E / 40.202029°N 29.027140°E / 40.202029; 29.027140TypeFolkloric artCollectionsShadow play pPuppetsVisitors129,000 (2018)OwnerBursa Metropolitan Municipality Bursa Karagöz Museum (Turkish: Bursa Karagöz Müzesi) is a museum located at Osmangazi in Bursa...

 

British theoretical physicist (1937–2012) David OliveCBE FRS FLSWBornDavid Ian Olive(1937-04-16)16 April 1937[3]Middlesex, England[4]Died7 November 2012(2012-11-07) (aged 75)[5]Cambridge, EnglandNationalityBritishAlma mater University of Edinburgh (BA, 1958) St John's College, Cambridge (PhD, 1963) Known for GKO construction GSO projection Montonen–Olive duality Spouse Jenny Olive ​(m. 1963)​[4]AwardsDirac...

 

Public secondary school in Houston, Texas, U.S.Scarborough High SchoolScarborough at the 2016 MLK Day parade in Midtown, HoustonAddress4141 Costa Rica RoadHouston, Texas 77092U.S.Coordinates29°49′45″N 95°28′10.5″W / 29.82917°N 95.469583°W / 29.82917; -95.469583InformationTypePublic SecondaryMottoSuccess is about attitude and expectations everyday!Established1968 (1968)School districtHouston Independent School DistrictPrincipalRod TrevinoTeaching staff4...

Rio LargoMunisipalitasNegara BrasilNegara bagianAlagoasLuas • Total306,327 km2 (118,274 sq mi)Populasi (2010) • Total68.481 • Kepadatan0,22/km2 (0,58/sq mi) Rio Largo merupakan sebuah munisipalitas yang terletak di negara bagian Brasil di Alagoas. lbs Munisipalitas di AlagoasIbu kota: MaceióArapiraca Arapiraca Campo Grande Coité do Nóia Craíbas Feira Grande Girau do Ponciano Lagoa da Canoa Limoeiro de Anadia São Sebastião Taqu...

 

Cet article est une ébauche concernant une localité japonaise. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Pour les articles homonymes, voir Takashima (homonymie). Takashima-shi 高島市 Hôtel de ville de Takashima. Drapeau Administration Pays Japon Région Kansai Préfecture Shiga Démographie Population 46 551 hab. (octobre 2022) Densité 67 hab./km2 Géographie Coordonnées 35° 21...

 

Cet article est une ébauche concernant la psychologie. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Étude de proportion de différents visages par Albrecht Dürer. Illustration extraite d'un manuel de physiognomonie du XIXe siècle. La physiognomonie est une méthode pseudo-scientifique fondée sur l'idée que l'observation de l'apparence physique d'une personne, et principalement les traits de son vis...

Аналоговый многодорожечный магнитофон TASCAM 85 16B способен записывать 16 аудиодорожек на 1-дюймовой (2,54 см) ленте Многодорожечная запись (также многоканальная запись) — способ записи звука, который позволяет производить одновременную или последовательную запись большог...

 

Для улучшения этой статьи желательно: Найти и оформить в виде сносок ссылки на независимые авторитетные источники, подтверждающие написанное.После исправления проблемы исключите её из списка. Удалите шаблон, если устранены все недостатки. Карта побережья Арктики, иссл�...

 

هذه المقالة مَكتوبةٌ بطريقةٍ تخالف أسلوب ويكيبيديا، ويبدو أنها تعرض فرضياتٍ علميةٍ مبنيةٍ على مصادرَ أولية فقط. فضلاً، ساهم في تطوير هذه المقالة من خلال إعادة صياغتها وفق أسلوب الكتابة في الموسوعة واستبدال المصادر الثانوية بالمصادر الأولية. ما هي الحضارة الآسيوية؟. (يناي...

The Wenner electrode array consists of a line of four equally spaced electrodes. Current is injected through the outer electrodes and potential is measured between the inner electrodes. An electrode array is a configuration of electrodes used for measuring either an electric current or voltage. Some electrode arrays can operate in a bidirectional fashion, in that they can also be used to provide a stimulating pattern of electric current or voltage. Common arrays include: Schlumberger (Wenner...

 

Wamin Le château, monument historique. Blason Administration Pays France Région Hauts-de-France Département Pas-de-Calais Arrondissement Montreuil Intercommunalité Communauté de communes des 7 Vallées Maire Mandat Philippe Lejosne 2020-2026 Code postal 62770 Code commune 62872 Démographie Populationmunicipale 232 hab. (2021 ) Densité 32 hab./km2 Géographie Coordonnées 50° 24′ 51″ nord, 2° 03′ 41″ est Altitude Min. 54 mMax. 122&...