在64位Windows上使用16位汇编程序? [英] 16-bit Assembly on 64-bit Windows?

查看:127
本文介绍了在64位Windows上使用16位汇编程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我决定不久前开始学习汇编,因此我开始使用FASMW进行16位汇编. 但是,最近我有一台真正的新计算机运行Windows 7 64位,现在该程序组装的已编译.COM文件都不再起作用.他们给出一条错误消息,指出.COM与64位Windows不兼容. 32位程序集仍然可以工作,但是我宁愿从16开始并逐步提高... 是否可以在Windows 7上运行16位程序?还是有一种特定的方式来编译它们?还是我应该放弃并跳到32位?

解决方案

之所以不能使用16位汇编程序,是因为 16位子系统 已从所有64- Windows版本.

解决此问题的唯一方法是先安装DOSBox之类的东西,或安装诸如VirtualBox之类的虚拟机软件包,然后再将FreeDOS安装到其中.这样,无论如何您将获得真正的DOS. ( NTVDM不是真正的DOS )

就个人而言,我是否鼓励为DOS编写16位程序集?不,我会使用32位甚至64位汇编程序-原因是针对不同的操作系统(称为ABI)存在一组不同的函数调用.因此,用于64位linux应用程序的ABI与32位应用程序不同.不知道Windows是否如此.但是,我保证中断的含义可能会有所不同.

此外,对于16位汇编,您还需要考虑各种因素,例如正在使用的内存模型.我可能是错的,但是我相信DOS可以为您提供64K的内存来玩就是这样".据我了解,所有内容,整个堆和堆栈以及代码都必须适合此空间,这使您想知道任何事情实际上是如何工作的.

I decided to start learning assembly a while ago, and so I started with 16-bit assembly, using FASMW. HOwever, I recently got a really new computer running Windows 7 64-bit, and now none of the compiled .COM files that the program assembles work anymore. they give an error message saying that the .COM is not compatible with 64-bit windows. 32-bit assemblies still work, however i'd rather start with 16 and work my way up... Is it possible to run a 16-bit program on windows 7? or is there a specific way to compile them? or should i give up and skip to 32-bit instead?

解决方案

The reason you can't use 16-bit assembly is because the 16-bit subsystem has been removed from all 64-bit versions of Windows.

The only way to remedy this is to install something like DOSBox, or a virtual machine package such as VirtualBox and then install FreeDOS into that. That way, you get true DOS anyway. (NTVDM is not true DOS)

Personally, would I encourage writing 16-bit assembly for DOS? No. I'd use 32- or even 64-bit assembly - the reason being there are a different set of function calls for different operating systems (called the ABI). So, the ABI for 64-bit linux apps is different to 32-bit ones. Not sure if that's the case with Windows. However, I guarantee that the meaning of interrupts is probably different.

Also, you've got all sorts of things to consider with 16-bit assembly, like the memory-model in use. I might be wrong, but I believe DOS gives you 64K memory to play with "and that's it". Everything, your entire heap and stack along with code must fit into this space, as I understand it, which makes you wonder how anything ever worked, really.

这篇关于在64位Windows上使用16位汇编程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆