Re: Assembly Question

From: Beth (BethStone21_at_hotmail.NOSPICEDHAM.com)
Date: 10/09/04


Date: Sat, 09 Oct 2004 02:50:02 GMT

Herman Dullink wrote:
> > The reason I ask is because 32bit asm programs don't run under 16bit
> > dos, even though the CPU is excatly the same.
>
> 32-bit programs do run under 16-bit DOS, but DOS has no loader for
> them. Most 32-bit programs either have 16-bit loader a part of the
> program (e.g. a DOS extender), or rely on another 32-bit program
> already running (e.g. Emm386, pre-NT Windows).

Actually, does anyone remember WIN32S? This allowed 32-bit Windows programs
to be executed under 16-bit Windows (which itself was a DOS
application)...so, actually, 32-bit programs could - to an extent -
actually be run via WIN32S and 16-bit Windows under what was essentially
the DOS operating system...basically, though, "why use WIN32S rather than
just use Windows 95?" was the mentality most people had and, hence, it was
never really used for anything but basic "compatibility" stuff...after all,
if your machine was good enough to run WIN32S, it was equally good enough
to run 32-bit Windows directly, so why not deal direct with the real thing?
Microsoft only created for "transition" with companies that, for some
reason, couldn't simply switch straight away to 32-bit Windows but might
need to run a Win32 app or two...

This add-on to 16-bit Windows was basically adding on the appropriate PE
loader, Win32 API set and that kind of thing...

Also, DOS was used by Microsoft as a "boot loader" for 32-bit Windows...and
you can use 32-bit "DOS extenders" to add 32-bit capabilities to DOS...

DOS itself doesn't support 32-bit programs simply because it was never
written that way...indeed, the design of DOS is firmly fixed in too many
"16-bit-isms" (real mode addressing "segments" are completely different in
16 bit and 32 bit mode on the x86 CPUs...well, you can use V86 mode for
"compatibility" but, really, you wouldn't want to do that, anyway, because
then suddenly you can only access 1MB of RAM only, as the 16-bit addresses
can't address more than that, thanks to Intel's nightmare "real mode
addressing" scheme :) to be easily converted...

Remember, DOS _predates_ the x86 becoming 32-bit with the '386 (it started
out life as a 16-bit CPU :)...and it really wasn't designed or written with
any "future proofing" in mind for going to 32-bits...and Intel completely
changed 32-bit addressing to work on a different scheme entirely to 16-bit
addressing (rightly so, from the perspective that 16-bit real mode
addressing was a horrid "hack" of a design...really ugly and reason numero
uno why the x86 got the reputation as such a horrid CPU to program)...

DOS itself doesn't run 32-bit programs (not without the required
"extenders" and such added on, anyway :), simply because it was never
designed to do so...if you like, this is similar to asking why "caveman
Bob" didn't use a flame thrower to "invent fire" back in the Stone
Age...because, simply, flame throwers weren't invented yet...DOS was
written for 16-bit x86 CPUs and when those CPUs went 32-bit, DOS stayed
where it was (basically because it was almost "hard-coded" in the way it
operated to be 16-bit and because Intel delibrately made changes to 32-bit
operation of the CPU - most specifically memory addressing, as the 16-bit
stuff was seriously flawed - as they added on the capability...the
rationale being simply "well, if programmers are going to have to rewrite
things to use the 32-bit capabilities, we might as well as also 'fix' a few
mistakes in the CPU design at the same time...

Beth :)



Relevant Pages

  • Re: 12 and 16-bit oscilloscopes
    ... >> I run DOS in Flat Real Mode and store the data in Extended ... process control, where Windows is simply too unreliable, and Linux ... cpu and don't have to give up cpu cycles for multitasking. ... The main point is sifting through a megabyte of data can be very ...
    (sci.electronics.design)
  • Re: quick ASM program
    ... for learning assembly programming. ... For DOS (or the DOS emulation ... in Windows) you need less than two hours to understand anything ... If you want to learn the language of the CPU, ...
    (alt.lang.asm)
  • PowerManagement und Netzwerk unter DOS
    ... habe hier ein IBM Thinkpad mit Centrino Technik (CPU, ... auf dem Rechner ein paar Programme im reinen DOS laufen sollen, ... Windows 95 installiert und per msdos.sys das Starten von Windows ... Unter Windows ist der Rechner oft lange Zeit komplett ruhig ...
    (de.comp.os.msdos)
  • Re: CPU Usage under Microsoft Virtual PC MS DOS 6.22
    ... I'm running MS DOS 6.22 via Microsoft Virtual PC on Windows XP ... fix the 100% CPU issue with my Clipper 5.01 executables. ... When I run these patched Clipper executables on my Win98SE system, ...
    (comp.lang.clipper)
  • Re: Would this be a good buy?
    ... and better graphics, but finding the time is a struggle. ... The real enthusiasts here know the difference between CPU ... boxes tend to have CPU and GPU of similar levels of pricing (if you want ... Windows 7 Home Premium (I'd advise getting Pro if you ever go ...
    (uk.comp.homebuilt)