<rahul8143@gmail.com> wrote in message
news:1128534736.435075.269810@g49g2000cwa.googlegr oups.com...[color=blue]
> 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?[/color]
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.
[color=blue]
> 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;[/color]
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