在 Visual Studio 2008 中使用 NASM 作为内联汇编编译器?

发布于 2024-08-02 07:28:26 字数 248 浏览 2 评论 0原文

我设法将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

未央 2024-08-09 07:28:27

我猜想内联汇编器是内置的(不是 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.

迷荒 2024-08-09 07:28:27

文档明确指出它是内置:

内联汇编器内置于编译器中,因此您不需要单独的汇编器,例如 Microsoft 宏汇编器 (MASM)。

不,没有办法使用插件。如果可以的话,添加对其他平台(ARM、x64 等)的支持将很容易,而不是完全不受支持。

The docs explicitly say that it is built in:

The inline assembler is built into the compiler, so you don't need a separate assembler such as the Microsoft Macro Assembler (MASM).

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文