有人在 Linux 下的 Wine 中使用过 MASM 汇编语言吗?
显然 WIne 不支持 16 位 DOS 应用程序。有人知道如何让 MASM 英特尔式汇编在 Wine 中工作吗?
Apparently WIne doesn't support 16bit DOS apps. Anyone know how to Get MASM intel-style assembly working in wine?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 DosBox
use DosBox
您是否尝试过使用NASM?它是免费、开源的,支持类似于 MASM 的类似 Intel 的语法 [我承认,我从未使用过],并且可以在几乎所有 x86 平台上运行,包括 Windows、Linux、BSD 等。
在典型的 Linux 发行版或BSD ports 树,它可能已经打包并准备好了。 (前提是您有 apt-get、pkgadd 或其他任何东西。)
Have you tried using NASM? It's free, open source, supports Intel-like syntax similar to MASM [which I admit, I've never used], and works on pretty much every x86 platform, including Windows, Linux, BSD, etc.
On your typical Linux distribution or BSD ports tree, it's probably already packaged and ready to go. (Provided you
apt-get
,pkgadd
, or whatever.)您的问题的解决方案可能就在那里:
http://www.japheth.de/JWasm.html
它是一个 MASM 语法兼容的开源汇编器(接近 100%,包括最奇怪的 MASM 寻址语法案例、结构化编程伪操作、宏等)。
它可以生成 Intel OMF、MS Coff(32 位和 64 位)、Elf(32 位和 64 位)、Bin 和 DOS MZ。
它以 DOS、Windows 和 Linux 二进制文件的形式存在。
它甚至可以构建到 OS/2、FreeBSD。
因此,您将拥有最大数量的汇编程序和目标二进制文件的组合,包括本机 Linux 下发生的所有情况。
如果您编译为 16 位代码,则必须在 16 位环境中执行它,这意味着您已经得到的建议之一。
但您也可以将 16 位语法编译为 32 位模式代码,具体取决于您想要执行的操作。因此,您也许能够在 32 位模式下执行 16 位算法,在 32 位环境中本机执行,就像 x86 架构允许的那样。不过,生成的代码会更大,因为汇编器将在每个 16 位指令之前生成 16 位转义码,但如果只是测试 16 位代码的逻辑,那么这是可以的。
我希望这对你有意义。如果没有,请要求更多...
The solution of your problem is probably there:
http://www.japheth.de/JWasm.html
It's a MASM syntax compatible open source assembler (close to 100%, including the most bizarre MASM addressing syntax cases, the structured programming pseudo-ops, macros and the like).
It can generate Intel OMF, MS Coff (32- and 64-bit), Elf (32-and 64-bit), Bin and DOS MZ.
And it exists as DOS, Windows and Linux binaries.
And it can even be built to OS/2, FreeBSD.
So you then have the maximum number of combinations of assembler and target binary, including those were everything happens under native Linux.
If you compile to 16-bit code, you'll have to execute it in a 16-bit environment, meaning one of the suggestions you already got.
But you might also be able to compile 16-bit syntax to 32-bit mode code, depending on what you are trying to do. So you might be able to execute 16-bit algorithms in 32-bit modes, executing natively in 32-bit environments, like the x86 architecture allows. The generated code will be larger, though, since the assembler will generate 16-bit escape codes ahead each 16-bit instruction, but this is OK if it's just a matter of testing the logic of your 16-bit code.
I hope this makes sense to you. If it didn't, ask for more...
使用DOSEMU在Linux/unix上运行16位dos程序
use DOSEMU to run 16-bit dos program on Linux / unix