| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Assembly Questions and Answers for Assembly here! |
![]() |
|
|
Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
Code:
#include <stdio.h>
class CHello{
public:
void fun()
{
printf("Hello World");
}
};
void main()
{
CHello hello;
_asm{
LEA EAX,hello
CALL [EAX]hello.fun
};
}
error C2411: 'fun' : illegal struct/union member in 'first operand' -------------------------------------------------------------------/ Tools : VC++6.0 |
|
#2
|
|||
|
|||
|
Re: C++ inline ASM
CALL [EAX]hello.fun()
|
|
#3
|
||||
|
||||
|
Re: C++ inline ASM
The thing you are trying to do has following issues:
To cut the long story: What you are trying todo is not fine coding style and (nearly) impossible.
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#4
|
||||
|
||||
|
Re: C++ inline ASM
Code:
#include <stdio.h>
char format[] = "%s %s\n";
char hello[] = "Hello";
char world[] = "world";
void main( void )
{
__asm
{
mov eax, offset world
push eax
mov eax, offset hello
push eax
mov eax, offset format
push eax
call printf
pop ebx
pop ebx
pop ebx
}
}
|
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|