flat assembler
Message board for the users of flat assembler.

Index > Heap > Can a 64bit processer run 16 bit programs?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
rCX



Joined: 29 Jul 2007
Posts: 166
Location: Maryland, USA
rCX
Does any one know if 64bit processors can run 16 bit programs? Can they use 16 bit registers?
Post 14 Jun 2008, 14:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17350
Location: In your JS exploiting you and your system
revolution
Short answer: Yes.

Long answer: Yes, of course.

Longer answer: Yes, but only if you use 16bit (RM) or 32bit (PM) modes. Long mode (64bit stuff) does not allow 16bit tasks.
Post 14 Jun 2008, 14:27
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
...so once you're utilizing the full power of your 64-bit processor, you need to emulate 16bit stuff. DosEmu, QEMU, BOCHS, VirtualPC, VMWare, ... - there's lots of possibilities. Heck, XP64 even includes a limited 16-bit emulator Wink
Post 14 Jun 2008, 14:58
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
They are completely backwards compatible. Even 16 bit protected mode is still supported :/
Post 14 Jun 2008, 15:02
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17350
Location: In your JS exploiting you and your system
revolution
vid wrote:
Even 16 bit protected mode is still supported :/
Yeah, but who uses that? Some old OS/2 freaks? Or worse, a QNX system, ugh.
Post 14 Jun 2008, 15:12
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
revolution wrote:
vid wrote:
Even 16 bit protected mode is still supported :/
Yeah, but who uses that? Some old OS/2 freaks? Or worse, a QNX system, ugh.
Hm, does QNX use 16bit pmode? O_o

Anyway, all the legacy support is such a shame, imho... would've been nice if Intel had started with a more-or-less clean slate (at least dropping 16bit pmode >_<) with the 386...

_________________
Image - carpe noctem
Post 14 Jun 2008, 15:26
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17350
Location: In your JS exploiting you and your system
revolution
f0dder wrote:
would've been nice if Intel had started with a more-or-less clean slate (at least dropping 16bit pmode >_<) with the 386...
At their peril. There was (and still is actually) a lot of 16bit proggies that they had to support else suffer financial ruin.

Didn't VIA make a 32bit PM only CPU?

And now AMD have started the death of the 16bit support with LM, so perhaps it will happen soon, we might see the end of 16bit HW support before we die.
Post 14 Jun 2008, 15:30
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
revolution wrote:
At their peril. There was (and still is actually) a lot of 16bit proggies that they had to support else suffer financial ruin.
How much 16bit pmode stuff, though, at the time the 80386 was released? Iirc win16 supported both RM and PM ("enhanced mode"). And dunno if VIA made a 32bit-only CPU, but they're too small to have a chance to affect the market, intel might've been able to pull it, though.

Long Mode itself isn't enough to end 16bit, but add (U)EFI to the mix... anyway, it's many years too late imho. But no point whining I guess, even if x86 isn't the best design possible, it's going to be with us many years to come.
Post 14 Jun 2008, 15:36
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17350
Location: In your JS exploiting you and your system
revolution
Even the perception that it could not run all the existing software would probably have been enough to temper the sales of a "broken" 80386. Of course, the guys at Intel are not stupid, they knew what they had to do to make sure the company still made huge profits. And besides, at that time, the continuing inclusion of PM16 may have only been a small amount of extra transistors to make it not worth the risk of removing it (not sure, just a guess).
Post 14 Jun 2008, 15:45
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
For DOS freaks, i think that Turbo Vision apps used 16bit PM.
Post 14 Jun 2008, 16:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
revolution wrote:
Short answer: Yes.

Long answer: Yes, of course.

Longer answer: Yes, but only if you use 16bit (RM) or 32bit (PM) modes. Long mode (64bit stuff) does not allow 16bit tasks.


Laughing

just, it is an evidence, INTEL build their ┬ÁP just for backward compatibility, otherwise, it would not have the success it have now...
Post 14 Jun 2008, 18:25
View user's profile Send private message Visit poster's website Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 166
Location: Maryland, USA
rCX
So the future 256bit processors will support 128bit, 64bit, 32bit and 16bit code for backward compatibility. Laughing
Post 14 Jun 2008, 18:40
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17350
Location: In your JS exploiting you and your system
revolution
I wonder if 128bit capable CPUs will ever be made? I'm talking about full 128bit internals, not just SSE or AVX. Because the current 64bit CPUs are not as efficient as 32bit on some tasks. Most noticeably when dealing with the wider addresses, so it would seem likely that 128bit might just be a bit of overkill. And, after all, 2^64 is LOTS of data. It would take a long time to fill 2^64 bytes of RAM.
Post 14 Jun 2008, 19:04
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
revolution: I doubt we'll see a CPU with more than 64bit of address space anytime soon - even 8 gigabytes of memory is a lot these days... and even when using the address space for other stuff (file mapping), 2^64 is indeed quote a large amount of bytes.

Yes, we all know the "640kb is enough for everybody" quote, and data amounts have been exploding... and once moving to distributed architectures etc. la la la... but I doubt we need >64bit *address space* for that, really.
Post 14 Jun 2008, 21:04
View user's profile Send private message Visit poster's website Reply with quote
dap



Joined: 01 Dec 2007
Posts: 61
Location: Belgium
dap
Randy Hyde points out in the book Write great code vol. 1 that the number of particules in the universe is estimated to around 2^76, so indeed we can say that we won't need more than 64 bits before a LONG time.
http://webster.cs.ucr.edu/WriteGreatCode/Vol1/Errata.html
Post 14 Jun 2008, 22:40
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17350
Location: In your JS exploiting you and your system
revolution
Erm. I think the current estimates of the visible universe are ~ 10^80, which is ~ 2^265.
Post 15 Jun 2008, 04:20
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
vid wrote:
For DOS freaks, i think that Turbo Vision apps used 16bit PM.


NO thanks Sad Some Boreland PASCAL and C compilers indeed used the 16-bit PM ... but it never worked well on 80836, even less on 80286 (no legal way back to RM !?!?! )

16-bit RM and 32-bit PM are very sufficient for me Wink

> Does any one know if 64bit processors can run 16 bit programs? Can they use 16 bit registers?

YES. As long as you don't enable the looooooooong mode, it acts like a fast 80386 with some additional instructions.

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 15 Jun 2008, 04:49
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
even less on 80286 (no legal way back to RM !?!?! )

1. No reason to go back to RM. Everything "legal" from RM (eg. excluding undocummented flat real mode tricks) runned just as fine in V86 mode.
2. I think you could use CPU reset trick, but I am not sure if it qualifies as "legal" :]

Btw, I never had any problem with any DOS Borland stuff. They always worked nicely and didn't break anything.
Post 15 Jun 2008, 08:06
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17350
Location: In your JS exploiting you and your system
revolution
vid: the 80286 PM mode does not run RM code natively. There is no v8086 mode in the 286. That is why there was such a negative reaction to 16bit PM. Everybody had to completely rewrite their code to use it. So, of course, almost nobody actually rewrote their code and instead just kept using RM.

The reset "trick", was the only way to return to RM. But it relied upon the BIOS to support jumping back to your code after the reset, and it used the RTC SRAM to store a value saying why the reset happened.
Post 15 Jun 2008, 08:22
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Turbo Vision didn't necessarily require PM16, it worked just fine with RM16 as well. And I personally never had any trouble with PM16 in Borland Pascal 7, always returned back to RM16 just fine on all machines I used it on (from 286 to K6-2 and basically everything inbetween).

Wasn't that useful though, and I abandoned ship as soon as I got a 32bit capable C++ compiler... there weren't any 32bit pascal compilers available back then - at least not any I knew of Smile
Post 15 Jun 2008, 11:59
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.