Re: [Dev-C++] inline assembly in winnt.h
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Lord S. <lor...@gm...> - 2005-07-06 17:29:23
|
How to use assembly with Dev-C++ ?
The "GNU as" assembler uses AT&T syntax (not Intel).
Here's an example of such a syntax :
// 2 global variables
int AdrIO;
static char ValIO;
void MyFunction(..........)
{
__asm("mov _AdrIO, %dx") ; // loading 16 bits register
__asm("mov _ValIO, %al") ; // loading 8 bits register
/*
Don't forget the underscore _ before each global variable names !
*/
__asm("mov %ax,%dx") ; // AX --> DX
}
That is quoted directly from the DevC++ help files.
I think that's what you're talking about, but just for clairity in our
archives, I'd like to post that (since I refer back to this stuff quite
often)
Sorry if someone already said that - I'm a bit bleary-eyed right now at 2300
at night ;) (my laptop's not connected right now, so I'm using the "send
later" button in Outlook Express - so if the message is postmarked
differently, I'm not off my rocker - yet)
Happy coding and may the Force be with you!
|