delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/15/22:45:28

From: "Paul Derbyshire" <pderbysh AT usa DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Assembly returns...
Lines: 33
Organization: The Chaos Zone
MIME-Version: 1.0
Message-ID: <pf671.1180$qR3.4125743@news20.bellglobal.com>
Date: Sat, 16 May 1998 01:48:05 GMT
NNTP-Posting-Host: 206.172.182.156
NNTP-Posting-Date: Fri, 15 May 1998 21:48:05 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

It's documented everywhere and generally frequently mentioned that "DJGPP C
functions return their values in eax"..... this makes sense for many cases.


class huge {
public:
  int f[900];
  bool b[20];
  char g[1048576];
  int foo (void);
}

huge voodoo (bool b) {
  //...
  return my_huge;
}

... so how the hell does THAT fit in eax?? :-)

I suppose objects bigger than 32 bits are implicitly passed by reference using
a pointer in eax, and the temporary is deleted only after receipt of the value
in the caller?


--
   .*.  "Clouds are not spheres, mountains are not cones, coastlines are not
-()  <  circles, and bark is not smooth, nor does lightning travel in a
   `*'  straight line."    -------------------------------------------------
        -- B. Mandelbrot  |http://www3.sympatico.ca/bob.beland/indexn2f.html
_____________________ ____|________     Paul Derbyshire     pderbysh AT usa DOT net
Programmer & Humanist|ICQ: 10423848|


- Raw text -


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