Calling C++ object member functions from ass ?K 
Author Message
 Calling C++ object member functions from ass ?K

        How can we call a C++ member function from assembly?

        For example:

        In C++:

                class Merry {
                public:
                        void CallMe();
                };

                Merry Xmas;

        In assembly:

                How to call Xmas.CallMe(); ?

--
? Origin: {|?3]-p??? ?? From: web.dialogue.com.tw



Tue, 12 Jun 2001 03:00:00 GMT  
 Calling C++ object member functions from ass ?K


Quote:

>         How can we call a C++ member function from assembly?

>         For example:

>         In C++:

>                 class Merry {
>                 public:
>                         void CallMe();
>                 };

>                 Merry Xmas;

>         In assembly:

>                 How to call Xmas.CallMe(); ?

<Jack>

This depends very much on the name mangling method used by the C++ compiler
and on where the "this" pointer is passed as well.  These vary from one
compiler brand to another and perhaps even from version to version of the same
compiler.

The easiest way to see what is going on is to write some small samples and
have your compiler generate assembly language instead of object code.  Then
study the assembly language to see the instructions generated for this type of
call.

Also most compilers come with a section on mixed-language programming in the
manual or the online help.

You might also try posting to a compiler specific support group, like

Regulars there are likely to be familiar with your specific compiler.

If you do post to a compiler group, or even here again, you should mention
your exact brand and version of compiler and the kind of program you are
trying to make, DOS, Win16, Win32, etc.  This information is likely to be
important to the answer.

</Jack>



Tue, 12 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Calling class member functions from C++

2. VC++ calling fortran function and fortran function calling a c++ function

3. member,ass,piece,mem ...

4. equivalent to C++ static member functions in Python?

5. Tcl_CreateObjCommand & C++ member functions

6. Seting a callback to a C++ member function

7. Registering C++ member functions

8. HOPE someone reads this: reposting:how can one embed a C++ member function that has arguments

9. Calling member methods from C++

10. Calling nested C++ members from Tcl -Segmentation errors.

11. Q: Creating an object member function using exec

12. Calling member functions?

 

 
Powered by phpBB® Forum Software