Just to piss people off I am going to top post a pre-amble here.
There have been a *LOT* of wrong things said in this "off-topic"
thread. So I thought I might chime in.
jacob navia said:
Some of what you said is correct, and some of what you said is incorrect
(for example: "It is NOT possible under win32 to access video memory in
the old DOS way!" is incorrect as stated, because it *is* possible - maybe
not in the way you envisage, but it *can* be done, either via an emulation
layer or through using a sufficiently old version of win32, such as
Win98).
Win32 is an execution mode invented by Microsoft in the late 80s or
early 90s. It *CANNOT* execute 16-bit code, and it does not emulate
the screen as a VGA interface. You are confusing it with v86 mode
which is a 16 bit DOS (and sometimes DPMI) emulation mode (which does
emulate a VGA interface as well). The two program environment modes
are distinguished at program-load time by the format of the
executable.
Where you have been correct, I have agreed with you. Where you have been
incorrect, I have disagreed with you.
Sort of. You've said a few incorrect things as well.
[...] If you would like to learn
something, therefore, I suggest that you read the parts of this discussion
where I disagreed with you.
You have to be kidding me. Who writes a Win32 compiler and is
unfamiliar with the basic execution modes of Windows? Do you really
think you said something jacob is not aware of? At *best* you guys
are having a communications breakdown. But more likely you see this
and are constructing this contrary point of view out of thin air as
part of some vendetta you have against him.
Let us actually try to help to OP (Eddie):
1. To compile and execute 16 assembly code in the manner you wish, you
need a 16-bit DOS compiler, of which there are many to choose from:
Turbo-C, a very old Microsoft C or "Quick C", Watcom C, Pacific C and
you need to run in a DOS compatible environment (such as MSDOS,
FreeDOS, Win 9X, Win3.1X, Win NT/XP32). lcc-win32, as the name
suggests does not produce 16 bit DOS compatible code.
2. It is possible to port your code to 32-bit DPMI assembly. The
interrupt *pattern* has a direct correspondence with the 16-bit
assembly code you wrote, but its got a lot of extra wrapper overhead.
If you do so, through a very complicated process, you *CAN* use a
win32 compiler (likely even lcc-win32 -- I don't know if it supports
in-line assembly or if its object format is OMF or some other
recognized standard) so long as you *LINK* it with a linker that can
produce a DOS-extended 32 bit application. The only linker I am aware
of that is that powerful and generic is the one that comes with Watcom
C/C++. I think they have retained this capability in "Open Watcom".
But if you are going to go to this much trouble, you might as well
just use the 32-bit DOS compiler that Watcom comes with in the first
place.
3. What Jacob is alluding to with the Vista 64 comment is the fact
that all of the 64-bit flavors of Windows (XP64, Vista64 and
Server2008/64 off the top of my head) do not natively support 16-bit
DOS except by special emulation (via VMWare, Virtual PC, or Hyper/V).
Similarly, you can do so with WINE under Linux. But this is all
besides the point.
4. If all you want to do is to be able to write text on a free
compiler with special colors, you can probably use lcc-win32 with the
standard Windows libraries. There is a console API for Windows
(though I am not familiar with it) and there is the API that Jacob is
suggesting that works in lcc-win32. Heck, there are even ways of
doing this using Direct X which you can program in either Win32 or
AMD64.
5. There are a few more choices amongst "free compilers" available to
you if you wish to program in Win32. Namely: Open Watcom, gcc, and
Microsoft Visual Studio Express. Open Watcom has the advantage that
it supports 16-bit DOS, 32-bit DOS and 32-bit Windows. Unfortunately,
it does not yet support 64-bit Windows as far as I know (but it sounds
like you are not concerned about that.) lcc-win32's main advantage,
as I understand it, is that it apparently comes with a very rich set
of extensions to the core C language.