Re: [Dev-C++] interupting registers using [DEV-C++]
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel K. O. <dan...@ya...> - 2004-02-05 05:52:59
|
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);
> }
>
Dev-C++ uses MinGW, that generates Win32 code. You can't do those
low-level stuffs in the Win32 environment. You probably want to use
DJGPP, if you wanna play with interrupting and other
assembly-directly-on-hardware stuffs.
Or, if you wanna try to learn things for real-life, use libraries like
Allegro or SDL (there are devpaks for both).
About the Intel vs AT&T syntax, I'll quote myself from a previous message:
----------------
First: GCC uses AT&T syntax by default, but it accepts Intel as well.
You can set which syntax you want to use by default, with the "-masm=x"
compiler option, where "x" can be:
"att" -> for AT&T syntax
"intel" -> for Intel syntax (d'oh....)
So, with -masm=intel you can write:
---
char hello[] = "Hello";
__asm(
"mov ebx, _hello \n"
"more intel asm here... \n"
);
---
And with -masm=att (the default) you can do:
---
char hello[] = "Hello";
__asm(
"mov $_hello, %ebx \n"
"more at&t asm here... \n"
);
---
If you want to mix ASM code, you can use ".intel_syntax" and
".att_syntax" to change the syntax for the next lines. Just don't
forget to change it back to the default syntax:
Option -> -masm=att
---
char hello[] = "Hello";
__asm(
".intel_syntax \n"
"mov ebx, _hello \n"
"more intel asm here... \n"
".att_syntax \n" // back to default syntax
);
---
Also, check:
http://www.codeproject.com/useritems/gccasm.asp
And also the Dev-Cpp's FAQ.
------------------
Daniel K. O.
|