vs08 如何编译 x64 的 汇编asm代码??

CCDDzclxy 2015-09-15 05:19:17
RT

在网上看了 一些文章,尝试着跟着弄了,但是总是不成功,总有这样那样的错误...求 一个 能成功的方式???


任何 指点、资料、链接 都行啊,感谢。
PS:希望是你尝试成功的方式,到时候 我尝试不成功的话,还可以继续请教你,谢谢各位。













...全文
445 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
fhw217 2015-09-16
  • 打赏
  • 举报
回复
引用
然后,项目 的属性-->配置属性-->链接器-->输入-->加载依赖项-->里面 填入“$(IntDir)\quick_sqrt.obj”。
这步不需要,直接编译解决方案。
zwfgdlc 2015-09-16
  • 打赏
  • 举报
回复
下载个intel编译器,直接内联汇编,要多简单就多简单
Saleayas 2015-09-16
  • 打赏
  • 举报
回复
asm 和 obj 只能添加一个进入链接。
CCDDzclxy 2015-09-16
  • 打赏
  • 举报
回复
看一下我的过程哪里不对??如下:

我的 自定义生成规则为 “Z_Assembler_64”(就是将原有的 规则"Microsoft Macro Assembler"复制了一份,只是将 ml.exe 改成了 ml64.exe)如下图:


我的 asm文件写成这样:(这个 asm文件的文件名为 quick_sqrt.asm )

;extern MessageBoxA:proc
.data
;text db 'Hello x64!',0
;caption db 'My First x64 Application',0
.code

AA proc
RET
AA endp

end


main函数那边 一点代码都没写,保持原样,如下图:


然后,项目 的属性-->配置属性-->链接器-->输入-->加载依赖项-->里面 填入“$(IntDir)\quick_sqrt.obj”。


在vs08中,直接 右键quick_sqrt.asm-->编译,可以看到 有 quick_sqrt.obj生成,且 没有报错。

但是,我 右键项目名称-->重新生成--> 它就报错了... 报错信息如下:



请问这是怎么回事啊???我哪里做的不对???

赵4老师 2015-09-16
  • 打赏
  • 举报
回复
引用 9 楼 zwfgdlc 的回复:
[quote=引用 8 楼 zhao4zhong1 的回复:] [quote=引用 5 楼 zwfgdlc 的回复:] 下载个intel编译器,直接内联汇编,要多简单就多简单
Intel编译器支持64位内联汇编?[/quote] 支持,你想下载试下[/quote] 可惜我的电脑是32位的。
zwfgdlc 2015-09-16
  • 打赏
  • 举报
回复
引用 8 楼 zhao4zhong1 的回复:
[quote=引用 5 楼 zwfgdlc 的回复:] 下载个intel编译器,直接内联汇编,要多简单就多简单
Intel编译器支持64位内联汇编?[/quote] 支持,你想下载试下
赵4老师 2015-09-16
  • 打赏
  • 举报
回复
引用 5 楼 zwfgdlc 的回复:
下载个intel编译器,直接内联汇编,要多简单就多简单
Intel编译器支持64位内联汇编?
fhw217 2015-09-15
  • 打赏
  • 举报
回复
给项目添加一个x64平台,然后在 “解决方案管理器” 右键点击 ”生成自定义“,在出现的对话框中选择 “MASM”,然后把 .asm文件添加到项目中。
孤客天涯 2015-09-15
  • 打赏
  • 举报
回复
先下载一个vsyasm-1.2.0-win32 然后 The YASM version vsyasm.exe is designed specifically for use with Visual Studio 2010. To tell Visual Studio where to find vsyasm.exe, the environment variable YASMPATH can be set to the absolute path of the directory in which vsyasm.exe is located (this path should include the final backslash). Alternatively you can find the directory (or directories) where the VC++ compiler binaries are located and put copies of the vsyasm.exe binary in these directories. The typical location on 64-bit Windows is: 如果系统为64位系统将vsyasm.exe拷贝至以下目录 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin On 32-bit Windows it is normally at: 如果系统为32位系统将vsyasm.exe拷贝至以下目录 C:\Program Files\Microsoft Visual Studio 10.0\VC\bin Depending on your system you can use either the win32 or the x64 version of vsyasm.exe, which must be named vsyasm.exe. To use the new custom tools facility in Visual Studio 2010, you need to place a copy of three files - yasm.props, yasm.targets and yasm.xml - into a location where they can be found by the Visual Studio build customisation processes. There are several ways to do this: a. put these files in the MSBUILD customisation directory, which is typically at: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations or: C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations b. put them in a convenient location and set this path in the 'Build Customisations Search Path' in the Visual Studio 'Projects and Solutions|VC++ Project Settings' item in the 'Tools|Options' menu; c. put them in a convenient location and set this path in the 'Build Customisation dialogue (discussed later). To use YASM in a project, right click on the project in the Solution Explorer and select 'Build Customisations..'. This will give you a dialog box that allows you to select YASM as an assembler (note that your assembler files need to have the extension '.asm'). If you have used option c. above, you will need to let the dialogue find them using the 'Find Existing' button below the dialogue. To assemble a file with YASM, select the Property Page for the file and the select 'Yasm Assembler' in the Tool dialog entry. Then click 'Apply' and an additional property page entry will appear and enable YASM settings to be established.
oyljerry 2015-09-15
  • 打赏
  • 举报
回复
https://msdn.microsoft.com/en-us/library/hb5z4sxd.aspx

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧