⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nasmdoc.src

📁 一个汇编语言编译器源码
💻 SRC
📖 第 1 页 / 共 5 页
字号:
\# $Id: nasmdoc.src,v 2.3 1999/06/03 20:23:53 hpa Exp $
\#
\# Source code to NASM documentation
\#
\IR{-D} \c{-D} option
\IR{-E} \c{-E} option
\IR{-I} \c{-I} option
\IR{-P} \c{-P} option
\IR{-U} \c{-U} option
\IR{-a} \c{-a} option
\IR{-d} \c{-d} option
\IR{-e} \c{-e} option
\IR{-f} \c{-f} option
\IR{-i} \c{-i} option
\IR{-l} \c{-l} option
\IR{-o} \c{-o} option
\IR{-p} \c{-p} option
\IR{-s} \c{-s} option
\IR{-u} \c{-u} option
\IR{-w} \c{-w} option
\IR{!=} \c{!=} operator
\IR{$ here} \c{$} Here token
\IR{$$} \c{$$} token
\IR{%} \c{%} operator
\IR{%%} \c{%%} operator
\IR{%+1} \c{%+1} and \c{%-1} syntax
\IA{%-1}{%+1}
\IR{%0} \c{%0} parameter count
\IR{&} \c{&} operator
\IR{&&} \c{&&} operator
\IR{*} \c{*} operator
\IR{..@} \c{..@} symbol prefix
\IR{/} \c{/} operator
\IR{//} \c{//} operator
\IR{<} \c{<} operator
\IR{<<} \c{<<} operator
\IR{<=} \c{<=} operator
\IR{<>} \c{<>} operator
\IR{=} \c{=} operator
\IR{==} \c{==} operator
\IR{>} \c{>} operator
\IR{>=} \c{>=} operator
\IR{>>} \c{>>} operator
\IR{?} \c{?} MASM syntax
\IR{^} \c{^} operator
\IR{^^} \c{^^} operator
\IR{|} \c{|} operator
\IR{||} \c{||} operator
\IR{~} \c{~} operator
\IR{%$} \c{%$} and \c{%$$} prefixes
\IA{%$$}{%$}
\IR{+ opaddition} \c{+} operator, binary
\IR{+ opunary} \c{+} operator, unary
\IR{+ modifier} \c{+} modifier
\IR{- opsubtraction} \c{-} operator, binary
\IR{- opunary} \c{-} operator, unary
\IR{alignment, in bin sections} alignment, in \c{bin} sections
\IR{alignment, in elf sections} alignment, in \c{elf} sections
\IR{alignment, in win32 sections} alignment, in \c{win32} sections
\IR{alignment, of elf common variables} alignment, of \c{elf} common
variables
\IR{alignment, in obj sections} alignment, in \c{obj} sections
\IR{a.out, bsd version} \c{a.out}, BSD version
\IR{a.out, linux version} \c{a.out}, Linux version
\IR{autoconf} Autoconf
\IR{bitwise and} bitwise AND
\IR{bitwise or} bitwise OR
\IR{bitwise xor} bitwise XOR
\IR{block ifs} block IFs
\IR{borland pascal} Borland, Pascal
\IR{borland's win32 compilers} Borland, Win32 compilers
\IR{braces, after % sign} braces, after \c{%} sign
\IR{bsd} BSD
\IR{c calling convention} C calling convention
\IR{c symbol names} C symbol names
\IA{critical expressions}{critical expression}
\IA{command line}{command-line}
\IA{case sensitivity}{case sensitive}
\IA{case-sensitive}{case sensitive}
\IA{case-insensitive}{case sensitive}
\IA{character constants}{character constant}
\IR{common object file format} Common Object File Format
\IR{common variables, alignment in elf} common variables, alignment
in \c{elf}
\IR{common, elf extensions to} \c{COMMON}, \c{elf} extensions to
\IR{common, obj extensions to} \c{COMMON}, \c{obj} extensions to
\IR{declaring structure} declaring structures
\IR{default-wrt mechanism} default-\c{WRT} mechanism
\IR{devpac} DevPac
\IR{djgpp} DJGPP
\IR{dll symbols, exporting} DLL symbols, exporting
\IR{dll symbols, importing} DLL symbols, importing
\IR{dos} DOS
\IR{dos archive} DOS archive
\IR{dos source archive} DOS source archive
\IA{effective address}{effective addresses}
\IA{effective-address}{effective addresses}
\IR{elf shared libraries} \c{elf} shared libraries
\IR{freebsd} FreeBSD
\IR{freelink} FreeLink
\IR{functions, c calling convention} functions, C calling convention
\IR{functions, pascal calling convention} functions, Pascal calling
convention
\IR{global, aoutb extensions to} \c{GLOBAL}, \c{aoutb} extensions to
\IR{global, elf extensions to} \c{GLOBAL}, \c{elf} extensions to
\IR{got} GOT
\IR{got relocations} \c{GOT} relocations
\IR{gotoff relocation} \c{GOTOFF} relocations
\IR{gotpc relocation} \c{GOTPC} relocations
\IR{linux elf} Linux ELF
\IR{logical and} logical AND
\IR{logical or} logical OR
\IR{logical xor} logical XOR
\IR{masm} MASM
\IA{memory reference}{memory references}
\IA{misc directory}{misc subdirectory}
\IR{misc subdirectory} \c{misc} subdirectory
\IR{microsoft omf} Microsoft OMF
\IR{mmx registers} MMX registers
\IA{modr/m}{modr/m byte}
\IR{modr/m byte} ModR/M byte
\IR{ms-dos} MS-DOS
\IR{ms-dos device drivers} MS-DOS device drivers
\IR{multipush} \c{multipush} macro
\IR{nasm version} NASM version
\IR{netbsd} NetBSD
\IR{omf} OMF
\IR{openbsd} OpenBSD
\IR{operating-system} operating system
\IR{os/2} OS/2
\IR{pascal calling convention}Pascal calling convention
\IR{passes} passes, assembly
\IR{perl} Perl
\IR{pic} PIC
\IR{pharlap} PharLap
\IR{plt} PLT
\IR{plt} \c{PLT} relocations
\IA{pre-defining macros}{pre-define}
\IR{qbasic} QBasic
\IA{rdoff subdirectory}{rdoff}
\IR{rdoff} \c{rdoff} subdirectory
\IR{relocatable dynamic object file format} Relocatable Dynamic
Object File Format
\IR{relocations, pic-specific} relocations, PIC-specific
\IA{repeating}{repeating code}
\IR{section alignment, in elf} section alignment, in \c{elf}
\IR{section alignment, in bin} section alignment, in \c{bin}
\IR{section alignment, in obj} section alignment, in \c{obj}
\IR{section alignment, in win32} section alignment, in \c{win32}
\IR{section, elf extensions to} \c{SECTION}, \c{elf} extensions to
\IR{section, win32 extensions to} \c{SECTION}, \c{win32} extensions to
\IR{segment alignment, in bin} segment alignment, in \c{bin}
\IR{segment alignment, in obj} segment alignment, in \c{obj}
\IR{segment, obj extensions to} \c{SEGMENT}, \c{elf} extensions to
\IR{segment names, borland pascal} segment names, Borland Pascal
\IR{shift commane} \c{shift} command
\IA{sib}{sib byte}
\IR{sib byte} SIB byte
\IA{standard section names}{standardised section names}
\IR{symbols, exporting from dlls} symbols, exporting from DLLs
\IR{symbols, importing from dlls} symbols, importing from DLLs
\IR{tasm} TASM
\IR{test subdirectory} \c{test} subdirectory
\IR{tlink} TLINK
\IR{underscore, in c symbols} underscore, in C symbols
\IR{unix} Unix
\IR{unix source archive} Unix source archive
\IR{val} VAL
\IR{version number of nasm} version number of NASM
\IR{visual c++} Visual C++
\IR{www page} WWW page
\IR{win32} Win32
\IR{windows} Windows
\IR{windows 95} Windows 95
\IR{windows nt} Windows NT
\# \IC{program entry point}{entry point, program}
\# \IC{program entry point}{start point, program}
\# \IC{MS-DOS device drivers}{device drivers, MS-DOS}
\# \IC{16-bit mode, versus 32-bit mode}{32-bit mode, versus 16-bit mode}
\# \IC{c symbol names}{symbol names, in C}

\C{intro} Introduction

\H{whatsnasm} What Is NASM?

The Netwide Assembler, NASM, is an 80x86 assembler designed for
portability and modularity. It supports a range of object file
formats, including Linux \c{a.out} and ELF, NetBSD/FreeBSD, COFF,
Microsoft 16-bit OBJ and Win32. It will also output plain binary
files. Its syntax is designed to be simple and easy to understand,
similar to Intel's but less complex. It supports Pentium, P6 and MMX
opcodes, and has macro capability.

\S{yaasm} Why Yet Another Assembler?

The Netwide Assembler grew out of an idea on \i\c{comp.lang.asm.x86}
(or possibly \i\c{alt.lang.asm} - I forget which), which was
essentially that there didn't seem to be a good free x86-series
assembler around, and that maybe someone ought to write one.

\b \i\c{a86} is good, but not free, and in particular you don't get any
32-bit capability until you pay. It's DOS only, too.

\b \i\c{gas} is free, and ports over DOS and Unix, but it's not very good,
since it's designed to be a back end to \i\c{gcc}, which always feeds
it correct code. So its error checking is minimal. Also, its syntax
is horrible, from the point of view of anyone trying to actually
\e{write} anything in it. Plus you can't write 16-bit code in it
(properly).

\b \i\c{as86} is Linux-specific, and (my version at least) doesn't seem to
have much (or any) documentation.

\b \i{MASM} isn't very good, and it's expensive, and it runs only under
DOS.

\b \i{TASM} is better, but still strives for \i{MASM} compatibility, which
means millions of directives and tons of red tape. And its syntax is
essentially \i{MASM}'s, with the contradictions and quirks that entails
(although it sorts out some of those by means of Ideal mode). It's
expensive too. And it's DOS-only.

So here, for your coding pleasure, is NASM. At present it's
still in prototype stage - we don't promise that it can outperform
any of these assemblers. But please, \e{please} send us bug reports,
fixes, helpful information, and anything else you can get your hands
on (and thanks to the many people who've done this already! You all
know who you are), and we'll improve it out of all recognition.
Again.

\S{legal} Licence Conditions

Please see the file \c{Licence}, supplied as part of any NASM
distribution archive, for the \i{licence} conditions under which you
may use NASM.

\H{contact} Contact Information

The current version of NASM (since 0.98) are maintained by H. Peter
Anvin, \W{mailto:hpa@zytor.com}\c{hpa@zytor.com}. If you want to report
a bug, please read \k{bugs} first.

NASM has a \i{WWW page} at
\W{http://www.cryogen.com/Nasm}\c{http://www.cryogen.com/Nasm}.

The original authors are \i{e\-mail}able as
\W{mailto:jules@earthcorp.com}\c{jules@earthcorp.com} and
\W{mailto:anakin@pobox.com}\c{anakin@pobox.com}.

\i{New releases} of NASM are uploaded to
\W{ftp://ftp.kernel.org/pub/software/devel/nasm/}\i\c{ftp.kernel.org},
\W{ftp://sunsite.unc.edu/pub/Linux/devel/lang/assemblers/}\i\c{sunsite.unc.edu},
\W{ftp://ftp.simtel.net/pub/simtelnet/msdos/asmutl/}\i\c{ftp.simtel.net}
and
\W{ftp://ftp.coast.net/coast/msdos/asmutil/}\i\c{ftp.coast.net}.
Announcements are posted to
\W{news:comp.lang.asm.x86}\i\c{comp.lang.asm.x86},
\W{news:alt.lang.asm}\i\c{alt.lang.asm},
\W{news:comp.os.linux.announce}\i\c{comp.os.linux.announce} and
\W{news:comp.archives.msdos.announce}\i\c{comp.archives.msdos.announce}
(the last one is done automagically by uploading to
\W{ftp://ftp.simtel.net/pub/simtelnet/msdos/asmutl/}\c{ftp.simtel.net}).

If you don't have Usenet access, or would rather be informed by
\i{e\-mail} when new releases come out, you can subscribe to the
\c{nasm-announce} email list by sending an email containing the line
\c{subscribe nasm-announce} to
\W{mailto:majordomo@linux.kernel.org}\c{majordomo@linux.kernel.org}.

If you want information about NASM beta releases, please subscribe to
the \c{nasm-beta} email list by sending an email containing the line
\c{subscribe nasm-beta} to
\W{mailto:majordomo@linux.kernel.org}\c{majordomo@linux.kernel.org}.

\H{install} Installation

\S{instdos} \i{Installing} NASM under MS-\i{DOS} or Windows

Once you've obtained the \i{DOS archive} for NASM, \i\c{nasmXXX.zip}
(where \c{XXX} denotes the version number of NASM contained in the
archive), unpack it into its own directory (for example
\c{c:\\nasm}).

The archive will contain four executable files: the NASM executable
files \i\c{nasm.exe} and \i\c{nasmw.exe}, and the NDISASM executable
files \i\c{ndisasm.exe} and \i\c{ndisasmw.exe}. In each case, the
file whose name ends in \c{w} is a \i{Win32} executable, designed to
run under \i{Windows 95} or \i{Windows NT} Intel, and the other one
is a 16-bit \i{DOS} executable.

The only file NASM needs to run is its own executable, so copy
(at least) one of \c{nasm.exe} and \c{nasmw.exe} to a directory on
your PATH, or alternatively edit \i\c{autoexec.bat} to add the
\c{nasm} directory to your \i\c{PATH}. (If you're only installing the
Win32 version, you may wish to rename it to \c{nasm.exe}.)

That's it - NASM is installed. You don't need the \c{nasm} directory
to be present to run NASM (unless you've added it to your \c{PATH}),
so you can delete it if you need to save space; however, you may
want to keep the documentation or test programs.

If you've downloaded the \i{DOS source archive}, \i\c{nasmXXXs.zip},
the \c{nasm} directory will also contain the full NASM \i{source
code}, and a selection of \i{Makefiles} you can (hopefully) use to
rebuild your copy of NASM from scratch. The file \c{Readme} lists the
various Makefiles and which compilers they work with.

Note that the source files \c{insnsa.c}, \c{insnsd.c}, \c{insnsi.h}
and \c{insnsn.c} are automatically generated from the master

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -