Date: Wed, 3 May 2000 11:48:03 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: Assembly and C++ In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 2 May 2000, Damian Yerrick wrote: > >> How can I make class member functions with NASM or GAS ? > > > >I think it is much easier to use inline assembly, or to call a > >function declared extern "C" from a C++ wrapper. > > But you lose all of C++'s cool OOP features. Not with inline assembly, you won't. Anyway, that's why I think the first question should be: do I really need to do it in assembly? > >Otherwise, you will probably need to understand how does the > >compiler mangle the names of C++ identifiers > > Is this in any documentation? I don't know, but you have cxxfilt that can demangle, and you have sources to see how does it do that. > >and the code you write could be broken by any new version of > >the compiler. > > Shouldn't the mangling method be part of the object file format spec, > like the initial underline is in COFF? No, binutils only see the mangled names, which are simply symbols as far as they are concerned. But by ``could be broken'' I didn't mean the mangling (which will probably not change much, if at all), but the wrapping code, such as what was posted by the original poster: the frame info and the rest of the stuff required for exceptions support. This tends to change with every compiler release (that's why mixing different versions doesn't work with C++ programs). C++ is a monstrously large and complex language, and it shows...