delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/02/07:44:13

From: "Traveler" <traveler AT netti DOT fi>
Newsgroups: comp.os.msdos.djgpp
Subject: Assembly and C++
Date: Tue, 2 May 2000 14:54:19 +0300
Organization: SAUNALAHDEN asiakas
Lines: 70
Message-ID: <8emeld$chk$1@tron.sci.fi>
NNTP-Posting-Host: mmmdccxxiv.hdyn.saunalahti.fi
X-Trace: tron.sci.fi 957267437 12852 195.197.164.124 (2 May 2000 11:37:17 GMT)
X-Complaints-To: newsmaster AT saunalahti DOT fi
NNTP-Posting-Date: 2 May 2000 11:37:17 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi!

How can I make class member functions with NASM or GAS ?

example:

"class    Trivial
{
public:
        void    doesnothing();
protected:
private:
};"

(Yes, I know that the above function would be "__doesnothing___Fv" or
something like that if it would be
 non-member function)

NASM:

"bits    32
global                ; what do I but here ???
section    .text
...
...
..."

Also, could somebody explain me the assembly code produced by the compiler
when I use overloaded/template functions (like the following)?

test.cc
"template <class T>
void    swap(T& a,T& b)
{
    T    temp = a;
    a = b;
    b = temp;
}"

compiled with "gxx -S test.cc" produces the following:

    .file    "test.cc"
gcc2_compiled.:
___gnu_compiled_cplusplus:    ; After this line Im totally out...
    .section    .eh_frame
___FRAME_BEGIN__:
    .long LLCIE1
LSCIE1:
    .long    0
        .byte    0x1
        .byte    0x0
        .byte    0x1
        .byte    0x7c
        .byte    0x8
        .byte    0xc
        .byte    0x5
        .byte    0x4
        .byte    0x88
        .byte    0x1
    .p2align 2,0
LECIE1:
        .set    LLCIE1,LECIE1-LSCIE1


Traveler2000AD
traveler AT netti DOT fi




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019