Re: [Dev-C++] interupting registers using [DEV-C++]
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Obi <ob...@ch...> - 2004-02-05 06:17:38
|
At 16:36 05/02/2004 +1100, AFRO MEISTER wrote:
>I have been trying to generate graphics and found a tutorial that
>contained information on interupting a graphics register using assembly in
>order to create graphics, but I have come across the problem that DEV-C++
>does not use Intel assebly whereas my tutorial does. here is the function
>that it uses to "turn on" graphics capabilities:
>
>void SetMCGA()
> {
> _AX = 0x0013;
> geninterrupt (0x10);
> }
The gcc way is to use an "asm block", like so:
void SetMCGA()
{
asm ( "mov $0x13,%%ax;"
"int $0x10;"::: "ax" );
}
However you've got a bigger problem. Attempting this code in a windows app
will just cause
a violation and kill your program.
You can do this if you're writing to DOS (I imagine it's fine in djgpp),
but not windows.
If you want access to the display in windows use SDL or DirectX (or OpenGl,
Allegro etc, etc, etc...)
Cheers,
Andy
|