Sorry to start another thread about this, but the newsserver complained
about 8-bit data in header.
"Bruno Barros" <> wrote in message
news: oups.com...
> Hello,
>
> I donīt know if union REGS <dos.h> is part of this group, but i have
> a problem. At the moment i use turboc++lite and i donīt have reply
> when i execute the question code. Only a black screen! Anyone help me?
> Whatīs is wrong? This code return the DOS version.
>
> #include <stdio.h>
> #include <dos.h>
> #include <conio.h> //use getch() e clrscr()
>
> void main(void)
> {
> union REGS in_regs, out_regs;
> in_regs.x.ax = 0x3000;
>
> intdos(&in_regs,&out_regs);
> printf("Version %d.%d\n", out_regs.x.ax & 0xFF, out_regs.x.ax
> >>
;
> }
Except for the headers, the code _appears_ correct for use with DJGPP and
OpenWatcom. However, I would suggest using memset() to clear in_regs befor
calling the DOS interrupt. If REGS is setup the same as DJGPP or OW, you
can use out_regs.h.ah or out_regs.h.al. You could probably post the code of
in openwatcom.user.c_cpp or comp.os.mdsos.djgpp for more responses.
Rod Pemberton