Thread: [Dev-C++] Where are int86() and union REGS?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: James D. <sem...@ho...> - 2004-08-22 04:56:45
|
Hello.
I have been trying to program some low-level graphics routines for a console
application. All of the
C++ books I have read have used the data structure union REGS to represent
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 'int'
command was
called.
int mode = -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 interrupt
// for changing screen mode.
mode = local_mode;
asm( "movb $0xF,%ah" ); // The BIOS interrupt to return
// the video mode.
asm( "int $0x10" ); // The Video BIOS
interrupt.
asm( "movb %al,_oldmode" ); // Stick the mode value (in %al)
// 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 mode.
asm( "movb _mode,%al" ); // Put the mode into %al
asm( "int $0x10" ); // Video BIOS interrupt.
}
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 to
use assembly to the
same extent?
Gratefully,
From the Assembly-Migraine afflicted.
_________________________________________________________________
Theres never been a better time to get Xtra JetStream @
http://xtra.co.nz/jetstream
|
|
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
>
|
|
From: David M. <dml...@co...> - 2004-08-23 02:31:14
|
What version of windows are you running if you are running any version
of NT (including 2000 & XP) then no matter what the compiler you will
get this crash. You will have to use a graphics library to program
graphics on any of these OSes (allegro, SDL, OpenGL, DirectX, are some
options you can look into.
James Dent wrote:
> Hello.
> I have been trying to program some low-level graphics routines for a
> console application. All of the
> C++ books I have read have used the data structure union REGS to
> represent 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
> 'int' command was
> called.
>
> int mode = -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 interrupt
> // for changing screen mode.
>
> mode = local_mode;
>
> asm( "movb $0xF,%ah" ); // The BIOS interrupt to
> return
> // the video
> mode.
> asm( "int $0x10" ); // The Video BIOS
> interrupt.
> asm( "movb %al,_oldmode" ); // Stick the mode value (in
> %al)
> // 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
> mode.
> asm( "movb _mode,%al" ); // Put the mode into %al
> asm( "int $0x10" ); // Video BIOS interrupt.
> }
>
> 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 to use assembly to the
> same extent?
>
> Gratefully,
>
>> From the Assembly-Migraine afflicted.
>
|
|
From: Per W. <pw...@ia...> - 2004-08-23 07:16:35
|
Please notice that the request for for a Console application. Most
graphics libraries are limited to non-console mode.
The djgpp compiler contains a DOS-extender to allow it to work in a Win32
environment and still hook interrupts etc. Also, the built-in graphics
support uses VESA and runs in console mode.
/Per W
On Sun, 22 Aug 2004, David McKen wrote:
> What version of windows are you running if you are running any version
> of NT (including 2000 & XP) then no matter what the compiler you will
> get this crash. You will have to use a graphics library to program
> graphics on any of these OSes (allegro, SDL, OpenGL, DirectX, are some
> options you can look into.
>
>
> James Dent wrote:
>
> > Hello.
> > I have been trying to program some low-level graphics routines for a
> > console application. All of the
> > C++ books I have read have used the data structure union REGS to
> > represent 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
> > 'int' command was
> > called.
> >
> > int mode = -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 interrupt
> > // for changing screen mode.
> >
> > mode = local_mode;
> >
> > asm( "movb $0xF,%ah" ); // The BIOS interrupt to
> > return
> > // the video
> > mode.
> > asm( "int $0x10" ); // The Video BIOS
> > interrupt.
> > asm( "movb %al,_oldmode" ); // Stick the mode value (in
> > %al)
> > // 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
> > mode.
> > asm( "movb _mode,%al" ); // Put the mode into %al
> > asm( "int $0x10" ); // Video BIOS interrupt.
> > }
> >
> > 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 to use assembly to the
> > same extent?
> >
> > Gratefully,
> >
> >> From the Assembly-Migraine afflicted.
> >
>
>
> -------------------------------------------------------
> 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
>
|