[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
|