16 位和 32 位应用程序之间的最终区别是什么?
32 位 x86 是 16 位 x86 的超集。假设我用 16 位 x86 编写代码。理想情况下,它应该可以在 32 位 x86 系统上顺利运行。但事实并非如此。这里兼容性是一个问题。但到底为什么呢?是否因为32位x86机器上安装的32位操作系统在内存中加载程序不同并且管理内存不同? 不同的内存管理要求是 16 位和 32 位应用程序之间的真正区别吗?
32-bit x86 is a superset of 16-bit x86. Suppose I write a code in 16-bit x86. It should ideally work on system with 32-bit x86 without any hitch. But that is not the case. Compatibility is an issue here. But why exactly? Is it because 32-bit OS installed on 32-bit x86 machine loads the programs differently in the memory and manages the memory differently?
Are different memory-management requirements the real difference between 16-bit and 32-bit applications?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在Windows中:
在32位操作系统中运行16位程序的主要问题是大多数16位程序过去都在实模式下运行,而实模式不再受操作系统支持。这些模式根本不同,因此需要软件模拟。此外,由于所有 16 位 API 存根、DOS 功能和 BIOS 调用都不可用,程序将无法真正与操作系统交互,因此如果没有某种模拟,它们将无法使用。对于 Windows,NTVDM 会执行从 Windows NT3.1 开始的所有模拟。
当然,如果您的程序不需要与操作系统进行任何交互,您应该能够运行它。就操作码和指令集而言,32 位 x86 确实是 16 位 x86 的超集。只是代码平时运行的环境完全不同。
In Windows:
The major problem with running 16bit program in 32bit OS is that most of 16bit programs used to run on Real Mode, which is not supported anymore(by the OS). These modes are fundamentally different and therefore require software emulation. Also since all of the 16bit API stubs, DOS functions, and BIOS calls are not available, programs would not really be able to interact with the operating system, thus making them unusable without some kind of emulation. In case of Windows, NTVDM does all the emulation starting from Windows NT3.1.
Of course, if your program does not require any interaction with the OS, you should be able to run it. In terms of the opcodes and instruction set, it is true 32bit x86 is superset of 16bit x86. It's just that the environment in which the code usually runs on is completely different.
32 位和 16 位地址模式之间的唯一区别是这些操作数大小和地址大小前缀的含义和用法。
32 位应用程序是什么意思?
< a href="https://stackoverflow.com/questions/13173138/operand-size-prefix-in-16-bit-mode/14660027#14660027">16位模式下的操作数大小前缀
The only one difference between the 32 bit - and the 16 bit addressmode is the meaning and the usage of those operandsize- and addresssize prefixes.
what is meant by 32-bit application?
Operand size prefix in 16-bit mode
超级用户有一个相关的(64 位操作系统上的 16 位)讨论 在这里。
There's a related (16bit on 64bit OS) discussion at superuser here.