Re: running 32-bit code in LM64
Posted: Wed Sep 27, 2023 10:53 pm
Then you don't want x86.kerravon wrote:I want a simple 64-bit processor.
I'm pretty sure running 16-bit code in 32-bit mode is impossible. The instruction encoding is too different.kerravon wrote:But I do expect pure non-segmented 16-bit code (ie tiny memory model) code to run in PM32.
Why would you expect the 64-bit extension to 32-bit x86 to look like those architectures and not like the 32-bit extension to 16-bit x86?kerravon wrote:MIPS didn't. The transition from S360/67 to z/Arch didn't.
Intel already tried that. Have you ever noticed that every 32-bit instruction is valid in 16-bit mode? But no one writes 32-bit programs for 16-bit mode; 32-bit programs written for 32-bit mode are smaller and faster. AMD chose to avoid getting stuck with yet another x86 feature no one uses.kerravon wrote:Basically this is relying on hardware engineers to create a special mode because the software can't cope with registers and addressing increasing in size. So basically two CPUs in one. Because no-one could figure out how to do it with just one.
In 16-bit mode, opcode 0x66 is a prefix that means the instruction has a 32-bit operand, and opcode 0x67 is a prefix that means the instruction has a 32-bit address.kerravon wrote:Ok, what about reserving just two opcodes? One says "what follows is a new 32-bit instruction" and the other says "what follows is a new 64-bit instruction"? Or, let's say x'40' was chosen as the 32-bit opcode. Two x'40' in a row says 64-bit, 3 says 128-bit etc.
No, DPMI requires a 286 at minimum.kerravon wrote:And the DPMI call is supported even on an 8086, so that's not an issue, right?