在 Visual Studio 2008 中使用 NASM 作为内联汇编编译器?
我设法将 NASM 设置为单独的 .asm 文件的编译器,但我找不到将 NASM 设置为内联汇编器(__asm 指令)的编译器的方法。例如,
helloWorld db "Hello world !",0
不会编译(汇编器语法错误,找到“db”)。 有没有办法做到这一点 ?或者我必须使用 MASM 或使用其他开发环境? 谢谢 !
ps:顺便说一句,MSDN 没有提供任何线索:D
I managed to set NASM as compiler for separate .asm files, but I can't find a way to set NASM as compiler for inline assembler (__asm directive). For example,
helloWorld db "Hello world !",0
won't compile (assembler syntax error, found "db").
Is there a way to do that ? Or am I bound to use MASM or use another development environment ?
Thanks !
ps : by the way the MSDN doesn't give any clue :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜想内联汇编器是内置的(不是 MASM),并且不能被插件替换。
您可以使用外部汇编器(例如 MASM)本身(而不是作为“内联”汇编器)来创建对象 (
*.obj
) 文件,然后使用以下命令将这些对象文件链接到您的 C++ 代码:链接器。I guess that the inline assembler is built-in (isn't MASM), and can't be plug-replaced.
You can use an external assembler (e.g. MASM) by itself (not as an 'inline' assembler) to create object (
*.obj
) files, and then link these object files to your C++ code using the linker.文档明确指出它是内置:
不,没有办法使用插件。如果可以的话,添加对其他平台(ARM、x64 等)的支持将很容易,而不是完全不受支持。
The docs explicitly say that it is built in:
And no, there is no way to use plugins. If you could, adding support for other platforms (ARM, x64, etc) would be easy, instead of being completely unsupported.