Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run 16 bit code in an operating system that supports Intel IA-32e mode?

In the Intel 64 & IA-32 architecutures manual vol 3A, Chapter 9 Processor Management and Initialization, I found the the following:

Compatibility mode execution is selected on a code-segment basis. This mode allows legacy applications to coexist with 64-bit applications running in 64-bit mode. An operating system running in IA-32e mode can execute existing 16-bit and 32-bit applications by clearing their code-segment descriptor's CS.L bit to 0.

Does this mean that legacy 16-bit & 32-bit application can coexist with 64-bit application on an operating system running in IA-32e mode.

But as I know, legacy 16-bit code is generally not supported by 64-bit operating system. If it is supported, how can I startup a 16-bit application?

like image 872
Gary Yin Avatar asked Feb 15 '14 13:02

Gary Yin


People also ask

Can a 16-bit game be played on a 32-bit processor operating system?

Yes, you can run 16-bit programs in 32-bit Windows 7, even if the processor is 64-bit.

Can 16 bit application or code run on 64-bit systems?

16-bit applications, in particular, are not natively supported on 64-bit Windows 10 because the operating system lacks a 16-bit subsystem. This can even affect 32-bit applications that utilize a 16-bit installer.

Can 32-bit software run on 64-bit?

Can I run 32-bit programs on a 64-bit computer? Most programs made for the 32-bit version of Windows will work on the 64-bit version of Windows except for most Antivirus programs. Device drivers that are made for the 32-bit version of Windows will not work correctly on a computer running a 64-bit version of Windows.

Why can't 64-bit run 16-bit?

Because 64-bit handles have 32 significant bits: Note that 64-bit Windows does not support running 16-bit Windows-based applications. The primary reason is that handles have 32 significant bits on 64-bit Windows. Therefore, handles cannot be truncated and passed to 16-bit applications without loss of data.


1 Answers

16-bit DOS apps can't run under 64-bit Windows, because virtual-8086 mode isn't available in long mode

However 16-bit protected mode is still available, so technically it's possible to run 16-bit Windows 3.x apps. That's how Wine runs 16-bit Windows apps in 64-bit Linux. Unfortunately 64-bit Windows doesn't have the same capability, although the reason is not because 64-bit mode cannot run 16-bit instructions but because the significant part has been increased.

The primary reason is that handles have 32 significant bits on 64-bit Windows. Therefore, handles cannot be truncated and passed to 16-bit applications without loss of data.

https://docs.microsoft.com/en-us/windows/win32/winprog64/running-32-bit-applications

So if you want to run 16-bit apps on 64-bit Windows you have to use a virtual machine

For more detailed information please read Peter Cordes' answer

See also Can a 64-bit computer (x86) run a 16-bit OS natively, without emulation?

like image 52
phuclv Avatar answered Sep 18 '22 17:09

phuclv