编写 NASM 汇编程序文件的正确格式和语法

发布于 2024-10-04 01:47:00 字数 206 浏览 0 评论 0原文

在 NASM(Netwide Assembler)中编写汇编代码的正确格式是什么?当尝试在 NASM 中运行 MASM32 (Microsoft Assembler) 文件时,NASM 似乎无法识别某些特定于 MASM 的指令。

是否有任何资源或文档可以解释 MASM 和 NASM 之间的语法和格式差异?此外,将 MASM32 代码转换为 NASM 兼容代码的建议步骤或指南是什么?

What is the correct format for writing assembler code in NASM (Netwide Assembler)? When attempting to run a MASM32 (Microsoft Assembler) file in NASM, it appears that NASM does not recognize some MASM-specific instructions.

Are there any resources or documentation that explain the syntax and format differences between MASM and NASM? Additionally, what are the recommended steps or guidelines for converting MASM32 code to NASM-compatible code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

无悔心 2024-10-11 01:47:00

总有手册

它包括一个“MASM 用户快速入门”部分,解释了关键差异。

从 NASM 2.15 开始,有一个 MASM 兼容宏包 (%use masm),这将使 mov eax,dword ptr foo 在 NASM 中作为负载工作,以及其他功能。
但是 mov eax, foo 仍然是地址,而不是像 MASM 中那样的负载,因此您仍然需要手动移植代码。

There's always the manual.

It includes a "quick start for MASM users" section that explains the key differences.

Since NASM 2.15 there's a MASM-compatibility macro package (%use masm) which will make mov eax,dword ptr foo work as a load in NASM, among other features.
But mov eax, foo is still the address, not a load like in MASM, so you do still need to port your code manually.

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