|
From: Noorez K. <lor...@ho...> - 2006-05-04 19:59:58
|
I'm trying to learn how to use the __asm. Hear is something that i was
trying to learn from:
#include <stdio.h>
char format[] asm("format") = "%s %s\n";
char hello[] asm("hello") = "Hello" ;
char world[] asm("world") = "world";
int main( void )
{
__asm
(
"mov eax, offset world;"
"push eax;"
"mov eax, offset hello;"
"push eax;"
"mov eax, offset format;"
"push eax;"
"call printf;"
//clean up the stack so that main can exit cleanly
//use the unused register ebx to do the cleanup
"pop ebx;"
"pop ebx;"
"pop ebx;"
);
return 0;
}
The compile error is that it could not find printf. How do make the printf
function visible to the asm code?.
And one more question... I all other tutorials i've seen, when examples of
inlining assembly are shown, they are shown with braces{} and not (). When I
compile, i need to use () for it to work.
Is there something i'm missing here...?
_________________________________________________________________
Take advantage of powerful junk e-mail filters built on patented Microsoft®
SmartScreen Technology.
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
Start enjoying all the benefits of MSN® Premium right now and get the
first two months FREE*.
|