

Lookup IP Information

2 3 4 5 6 7 8 Next


Netwide Assembler Original author(s) Simon Tatham, Julian Hall Developer(s) H. Peter Anvin, et al. Stable release 2.09.03 / October 27, 2010; 19 days ago (2010-10-27) Operating system Microsoft Windows, Unix-like, OS/2, Mac OS, DOS Available in English Type x86 assembler License 2-clause BSD Website The Netwide Assembler (NASM) is an assembler and disassembler for the Intel x86 architecture. It can be used to write 16-bit, 32-bit (IA-32) and 64-bit (x86-64) programs. NASM is considered to be one of the most popular assemblers for Linux[1] and is the second most popular assembler overall, behind MASM.[2] NASM was originally written by Simon Tatham with assistance from Julian Hall, and is currently maintained by a small team led by H. Peter Anvin.[3] It is available as free software under the terms of the simplified (2-clause) BSD license.[4] Contents 1 Features 2 Examples of programs for various operating systems 3 Linking 4 Development 5 See also 6 References 7 Further reading 8 External links // Features NASM can output several binary formats including COFF, Portable Executable, a.out, ELF and Mach-O, though Position-independent code is only supported for ELF object files. NASM also has its own binary format called RDOFF.[5] The variety of output formats allows one to retarget programs to virtually any x86 operating system. In addition, NASM can create flat binary files, usable in writing boot loaders, ROM images, and various facets of OS development.[5] NASM can run on non-x86 platforms, such as SPARC and PowerPC, though it cannot output programs usable by those machines. NASM uses variation of Intel assembly syntax instead of AT&T syntax.[6] It also avoids features such as automatic generation of segment overrides (and the related ASSUME directive) used by MASM and compatible assemblers.[5] Examples of programs for various operating systems This is a Hello world program for the DOS operating system. 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, '$' An example of a similar program for Microsoft Windows: global _start extern _MessageBoxA@16 extern _ExitProcess@4 section code use32 class=code _start: 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 An equivalent program for Linux: section .data msg: db "Hello, world!", 10 .len: equ $ - msg section .text global _start _start: mov eax, 4 ; write mov ebx, 1 ; stdout mov ecx, msg mov edx, msg.len int 0x80 mov eax, 1 ; exit mov ebx, 0 int 0x80 Linking NASM principally outputs object files, which are generally not executable in and of themselves. The only exception to this are flat binaries (e.g., .COM)[5] which are inherently limited in modern use. To translate the object files into executable programs, an appropriate linker must be used, such as the Visual Studio "LINK" utility for Windows or ld for UNIX-like systems. Development On 28 November 2007, version 2.00 was released, adding support for x86-64 extensions.[3] The development versions are not uploaded to; instead, they are checked in to the project's own Git repository with binary snapshots available from the project web page. A search engine for NASM docs is also available.[7] See also Free software portal Assembly language List of assemblers Yasm References ^ Ram Narayan. "Linux assemblers: A comparison of GAS and NASM". "two of the most popular assemblers for Linux, GNU Assembler (GAS) and Netwide Assembler (NASM)"  ^ Randall Hyde. "Which Assembler is the Best?". Retrieved 2008-05-18. "In second place, undoubtedly, is the NASM assembler."  ^ a b "The Netwide Assembler". Retrieved 2008-06-27.  ^ "NASM Version History". Retrieved 2009-07-19.  ^ a b c d "NASM Manual". Retrieved 2009-08-15.  ^ Randall Hyde. "NASM: The Netwide Assembler". Retrieved 2008-06-27.  ^ "NASM Doc Search Engine". Retrieved 2009-09-14.  Further reading Jeff Duntemann (2000). Assembly Language Step by Step. J Wiley and Sons. ISBN 0471375233.  External links NASM website A comparison of GAS and NASM at IBM v • d • e x86 assembly topics Topics Assembly language · Comparison of assemblers · Disassembler · Microprocessor instruction set · Low-level programming language · Machine code · Microassembler · x86 assembly language x86 Assemblers A86/A386 · FASM · GAS · HLA · MASM · NASM · TASM · WASM · YASM Programming issues Call stack · Flags (Carry flag · Overflow flag · Zero flag) · Opcode · Program counter · Processor register · x86 calling conventions · x86 instruction listings · x86 registers