<ra*******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I want to know for what purpose union REGS and struct SREGS are
used in windows programming? also how following code an determine that
running OS is windows?
First of all, these types and the intel 80x86 CPU architecture are beyond
the scope of the standard C, and so is the compiler having support for them.
in_regs.x.ax = 0x160A;
int86x(0x2F, &in_regs, &out_regs, &seg_regs);
if (out_regs.x.ax == 0)
Running_WIN=TRUE;
provided here
union REGS in_regs, out_regs;
struct SREGS seg_regs;
As it has already been pointed out, for more on the DOS/windows interrupts,
see the Ralf Brown's Interrupt List freely available on the net. If you want
to know more about the intel 80x86 CPUs, you're welcome to
http://developer.intel.com -- get yourself free intel manuals, called
something like intel ia32 software architecture -- they're 3 volumes under
this name. If you want to know more about REGS and SREGS, please study the
documentation of your compiler. Borland C/C++ compiler for DOS comes with
built in help in the IDE, Watcom C/C++ compiler also comes with the full
documentation -- these are two compilers which I know to support this
feature.
Alex