VOGONS


Reply 20 of 23, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
Jo22 wrote on 2020-11-12, 02:13:

As I told a few times before, Long Mode allows 16-Bit Protected Mode instructions/code still.

It supports 16-bit data manipulation. It doesn't support 16-bit addressing or the use of segment registers, which were both essential features for 16-bit code.

Reply 21 of 23, by Jo22

User metadata
Rank l33t++
Rank
l33t++
jmarsh wrote on 2020-11-12, 03:43:
Jo22 wrote on 2020-11-12, 02:13:

As I told a few times before, Long Mode allows 16-Bit Protected Mode instructions/code still.

It supports 16-bit data manipulation. It doesn't support 16-bit addressing or the use of segment registers, which were both essential features for 16-bit code.

It allowes execution of clean 16-Bit code, just as the 286 Protected Mode did.
It does not allow any segment arimethics, though.
Which is good, because it's bad. 😉

Edit: Seems you're thinking in DOS/Real-Mode ways.. Just stop that. Open your mind and let the cosmic energies enlighten your mind. Or something like that. 😉
Seriously though, I meant that normal or proper "16-Bit code" can run in that mode.
As in.. Win16 binaries that do run fine in Windows 3.x Standard Mode. They are not allowed to do these arimethics.
Digital Research also supported multitasking of clean DOS programs in one of its DOS OSes.. On a 286 processor.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 22 of 23, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
Jo22 wrote on 2020-11-12, 05:01:

It allowes execution of clean 16-Bit code, just as the 286 Protected Mode did.

No it doesn't. The byte register encodings for long mode are different from 16-bit/32-bit mode, some combinations of operations simply aren't possible.
Even using compatibility mode, it is not valid to use small (16-bit) segments. This is why 64-bit windows is unable to run 16-bit apps even though it can run legacy 32-bit apps.

Reply 23 of 23, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie
jmarsh wrote on 2020-11-12, 06:23:
Jo22 wrote on 2020-11-12, 05:01:

It allowes execution of clean 16-Bit code, just as the 286 Protected Mode did.

No it doesn't. The byte register encodings for long mode are different from 16-bit/32-bit mode, some combinations of operations simply aren't possible.
Even using compatibility mode, it is not valid to use small (16-bit) segments. This is why 64-bit windows is unable to run 16-bit apps even though it can run legacy 32-bit apps.

Yes, it does. Only real mode and v86 mode is not available from long mode, 16-bit protected mode is. The reason that x64 Windows does not support any 16-bit programs is that NTVDM relies on v86 mode but it is really not supported in long mode so it should have been rewritten. MS did not want to do this.
From AMD64 Architecture Programmer’s Manual Volume 2:

2.1.1 Long Mode The AMD64 architecture introduces long mode and its two sub-modes: 64-bit mode and compatibility mode. 64-Bit […]
Show full quote

2.1.1 Long Mode
The AMD64 architecture introduces long mode and its two sub-modes: 64-bit mode and compatibility
mode.
64-Bit Mode. 64-bit mode provides full support for 64-bit system software and applications. The new
features introduced in support of 64-bit mode are summarized throughout this chapter. To use 64-bit
mode, a 64-bit operating system and tool chain are required.
Compatibility Mode. Compatibility mode allows 64-bit operating systems to implement binary
compatibility with existing 16-bit and 32-bit x86 applications. It allows these applications to run,
without recompilation, under control of a 64-bit operating system in long mode.
The architectural
enhancements introduced by the AMD64 architecture that support compatibility mode are
summarized throughout this chapter.
Unsupported Modes. Long mode does not support the following two operating modes:
• Virtual-8086 Mode—The virtual-8086 mode bit (EFLAGS.VM) is ignored when the processor is
running in long mode. When long mode is enabled, any attempt to enable virtual-8086 mode is
silently ignored. System software must leave long mode in order to use virtual-8086 mode.
• Real Mode—Real mode is not supported when the processor is operating in long mode because
long mode requires that protected mode be enabled.

So e.g. 16-bit segmented Windows 3.x NE executables could be run natively/without emulation in long mode of x64 Windows in theory but MS did not bother to implement it:
https://groups.google.com/g/alt.os.developmen … K6K7IUfvg?pli=1

Website, Facebook, Youtube
Falcosoft Midi Player + Munt VSTi + BassMidi VSTi topic