64位汇编器

来源:互联网 发布:维基百科 捐款 知乎 编辑:程序博客网 时间:2024/05/24 06:41
2009-10-15 16:49

64位汇编编译器(整理)

在支持64位汇编编译器已经很多很多了,这里只把我知道的几个,简单罗列一下,不足之处还请其他大侠予以纠正和加以补充:


(一)
·ml64.exe

这是VC++   2005里带的汇编编译器,只要你安装了Visual   Studio   2005软件,这个就有了。它的目录一般是在“Program   Files\Microsoft   Visual   Studio   8\VC\bin\amd64”,你在这里一定可以发现有个ml64.exe文件。从[开始菜单]-> [Microsoft   Visual   Studio   2005]-> [Visual   Studio   Tools]-> [Visual   Studio   2005   x64   兼容工具命令提示]也可以启动它,它启动命令行窗口一般先要执行一个批处理文件,就是“Program   Files\Microsoft   Visual   Studio   8\VC\vcvarsall.bat”,然后有了这个环境才可运行ml64.exe。

ml64.exe的详细用法可查看“ml64   /?”

Microsoft   (R)   Macro   Assembler   (x64)   Version   8.00.50727.762
Copyright   (C)   Microsoft   Corporation.     All   rights   reserved.

ML64   [   /options   ]   filelist   [   /link   linkoptions   ]

/Bl <linker>   Use   alternate   linker                     /Sf   Generate   first   pass   listing
/c   Assemble   without   linking                               /Sl <width>   Set   line   width
/Cp   Preserve   case   of   user   identifiers           /Sn   Suppress   symbol-table   listing
/Cx   Preserve   case   in   publics,   externs           /Sp <length>   Set   page   length
/D <name> [=text]   Define   text   macro                   /Ss <string>   Set   subtitle
/EP   Output   preprocessed   listing   to   stdout   /St <string>   Set   title
/F   <hex>   Set   stack   size   (bytes)                       /Sx   List   false   conditionals
/Fe <file>   Name   executable                                   /Ta <file>   Assemble   non-.ASM   file
/Fl[file]   Generate   listing                                 /w   Same   as   /W0   /WX
/Fm[file]   Generate   map                                         /WX   Treat   warnings   as   errors
/Fo <file>   Name   object   file                                 /W <number>   Set   warning   level
/Fr[file]   Generate   limited   browser   info       /X   Ignore   INCLUDE   environment   path
/FR[file]   Generate   full   browser   info             /Zd   Add   line   number   debug   info
/I <name>   Add   include   path                                   /Zf   Make   all   symbols   public
/link   <linker   options   and   libraries>             /Zi   Add   symbolic   debug   info
/nologo   Suppress   copyright   message                 /Zp[n]   Set   structure   alignment
/Sa   Maximize   source   listing                               /Zs   Perform   syntax   check   only
/errorReport: <option>   Report   internal   assembler   errors   to   Microsoft
none   -   do   not   send   report
prompt   -   prompt   to   immediately   send   report
queue   -   at   next   admin   logon,   prompt   to   send   report
send   -   send   report   automatically


(二)
·GoASM

下载地址:
http://www.jorgon.freeserve.co.uk

这个支持64位,它的编译器是GoAsm.exe,还有链接器GoLink.exe、资源编译器GoRC.exe、除错测试工具GoBug.exe和TestBug.exe等。

GoAsm.exe的详细用法可查看“goasm   -h”:

GoAsm.Exe   Version   0.56.03a-   Copyright   Jeremy   Gordon   2001/7   -   JG@JGnet.co.uk
Use   this   syntax   in   the   command   line:-

GoAsm   [command   line   switches]   inputfile[.ext]
(.asm   assumed   if   file   not   found   and   no   extension   specified)

Command   line   switches:-
/b=beep   on   error
/c=force   output   to   current   directory
/d=define   a   word   (eg.   /d   WORD=0x345)
/e=empty   output   file   allowed
/fo=specify   output   path/file   eg.   /fo   asm\myprog.obj
/h=this   help
/l=create   listing   output   file
/ms=decorate   for   ms   linker
/ne=no   error   messages         /ni=no   information   messages
/nw=no   warning   messages     /no=no   output   messages   at   all
/x64=assemble   for   AMD64   or   EM64T
/x86=assemble   64-bit   source   in   32-bit   compatible   mode


(三)
·YASM

YASM是一个跨平台、支持多种目标文件格式的汇编编译器,它有Windows/Linux/DOS等版本,它重写了停滞的NASM项目。并支持GAS(GNU   assembler)语法和AMD64(EM64T)架构,它的源代码在三条款BSD等授权下发放。

下载地址:
http://www.tortall.net/projects/yasm

它的源代码是以“.tar.gz”作文件扩展名的,比如yasm-0.6.0.tar.gz,源码用c语言和汇编写成,可以参考一下。64位编译器文件名 含有“win64”,比如yasm-0.6.0-win64.exe。下载了yasm-0.6.0-win64.exe可执行文件后,可将其改名为 “yasm.exe”以方便今后使用。yasm.exe的用法大致象这样:yasm   -o   object.o   source.asm

它还有许多选项参数,这些更具体用法请参考命令行“yasm   -h”


(四)
·FASM

它的全称是“Flat   Assembler”,支持64Bit汇编。

下载地址:
http://flatassembler.net

它的Windows版本运行文件FASMW.EXE可以在Windows下直接双击打开窗口,也可以带参数执行编译。fasmw直接编译源码文件的用法如下:

usage:   fasmw   <source>   [output]
optional   settings:
-m   <limit>     set   the   limit   in   kilobytes   for   the   memory   available   to   assembler
-p   <limit>     set   the   maximum   allowed   number   of   passes


(五)
·GAS

上面都说了不少支持Windows系统平台的,再说一个Linux下的64位编译器,就是GAS(GNU   Assembler)。GAS的编译器是“as”,它的链接器是“ld”,GAS的网址是“http://www.gnu.org/software /binutils”,GAS被包含在GNU   BinUtils包里,这个binutils最新版本是2.17。

下载地址:
http://ftp.gnu.org/gnu/binutils

在这个地址找到其最新版本的源代码文件,比如“binutils-2.17.tar.gz”,然后下载。

然后在Linux里解开这个“.tar.gz”文件并编译它的源码,关于怎样编译请参考README文件,无外乎:
./configure  
make
make   install
这样的命令。

编译后就可以运行“as”命令来编译汇编源文件了,as的进一步用法请参考“as   -help”。


应该还有其他很多支持64位汇编的编译器,我没说到的请其他人补充。
原创粉丝点击