RE: [Dev-C++] Simple inline assembly. What am I doing wrong?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2001-09-03 23:12:54
|
I do not know assembly (yet) but the general syntax is something like
that:
asm("modpc 0, 0, %0" : "=3Dr" (tmp));
Take a look at http://www.research.att.com/~bs/esc99.html too.
For getting windows errors 2 things are possible:
1) You do crazy things. :)
2) Windows work in protected mode, that means you can't access system
components directly. You can't draw graphics accessing the graphics card
directly for example. For this thing windows provide system calls (API)
like the Win32 API, MFC API, e.t.c.. This is the most possible cause of
your problems.
For example some time ago i was taking function pointers, assigned them
in a char * and i printed their contents in the monitor "to see how they
look like". This is possile to DOS but impossible to Windows since
memory is protected.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Leon Buikstra
> Sent: Monday, September 03, 2001 10:53 PM
> To: dev...@li...
> Subject: [Dev-C++] Simple inline assembly. What am I doing wrong?
>=20
>=20
> I've been trying to get assembly to work in Dev-C++, but I'm=20
> desperate!=20
> Here's what I tried: (replace periods at start of line with spaces)
>=20
> void SetMode13h()
> {
> ..asm("movw %ax,0x0013");
> ..asm("int $10");
> }
>=20
> It compiles alright, but when I call this function, I get a=20
> Windows error!=20
> It seems that the first asm line is wrong, and, I'm not sure=20
> whether the=20
> second line will work either! This was the idea I was trying=20
> to do (In=20
> ordinary assembler)
>=20
> Void SetMode13h()
> {
> ..asm
> ..{
> ....mov ax, 0x0013h
> ....int 10h
> ..}
> }
>=20
>=20
> Can anybody explain what's wrong with the code I wrote? And=20
> how can I fix=20
> it?
> Thanks, Leon Buikstra
>=20
> (If I sent this mail twice, blame chello!)
>=20
> _________________________________________________________________
> Get your FREE download of MSN Explorer at=20
> http://explorer.msn.com/intl.asp
>=20
>=20
>=20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|