Re: [Dev-C++] Where are int86() and union REGS?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-08-22 11:05:47
|
Take a look at the djgpp compiler. It is a DOS extender, i.e. for running
32-bit code from the original DOS command line. It has very good support
for graphics, and the applications runs from the Win32 command line too.
/Per W
On Sun, 22 Aug 2004, James Dent wrote:
> Hello.
> I have been trying to program some low-level graphics routines for a cons=
ole
> application. All of the
> C++ books I have read have used the data structure union REGS to represen=
t
> the registry, and
> functions such as int86(), outport, etc. etc. (included in dos.h). This
> header may be obsolete, or
> a Borland extension of C++ - I don't know. I turned to assembly to
> accomplish the same function,
> but the code shown below resulted in the Blue Screen of Death when the 'i=
nt'
> command was
> called.
>
> int mode =3D -1;
>
> void SetVideoMode (int local_mode)
> {
> // This function consists of two parts: firstly, it saves the current
> // video mode in the global variable oldmode, and secondly, it loads
> // various values into the registry and calls the Video BIOS interrup=
t
> // for changing screen mode.
>
> mode =3D local_mode;
>
> asm( "movb $0xF,%ah" ); // The BIOS interrupt to ret=
urn
> // the video mod=
e.
> asm( "int $0x10" ); // The Video BIOS
> interrupt.
> asm( "movb %al,_oldmode" ); // Stick the mode value (in %a=
l)
> // into the
> variable oldmode. */
>
> // The old mode has been retrieved, now all that needs to be done is =
the
> // actual mode changing.
>
> asm( "movb $0x0,%ah" ); // Interrupt 0h - Screen mod=
e.
> asm( "movb _mode,%al" ); // Put the mode into %al
> asm( "int $0x10" ); // Video BIOS interrupt=
=2E
> }
>
> I have never been very good at assembly, but this code has been terribly
> hard to debug. Does anyone
> know if a new version of the dos.h functions exists for Dev-C++, or how t=
o
> use assembly to the
> same extent?
>
> Gratefully,
> >From the Assembly-Migraine afflicted.
>
> _________________________________________________________________
> There=92s never been a better time to get Xtra JetStream @
> http://xtra.co.nz/jetstream
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|