delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/03/18:32:51

Xref: news2.mv.net comp.os.msdos.djgpp:3400
From: alexlehm AT rbg DOT informatik DOT th-darmstadt DOT de (Alexander Lehmann)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: register calling convention
Date: 3 May 1996 01:58:01 GMT
Organization: Technische Hochschule Darmstadt
Lines: 32
Message-ID: <4mbp79$mv9@rs18.hrz.th-darmstadt.de>
References: <199605021651 DOT JAA06116 AT bluesky DOT com>
NNTP-Posting-Host: hp62.rbg.informatik.th-darmstadt.de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Kevin Baca (kbaca AT skygames DOT com) wrote:
: > On 29 Apr 1996, S. Mikecin wrote:
: > 
: > > How to tell DJGPP to use "register calling convention"?
: > > In Borland C++ it can be done for a particular user function using reserved
: > > word _fastcall. In Watcom C/C++ it is by default (also works with standard
: > > functions)! But what about DJGPP?
: > 
: > Use the -mregparm=n (where n is a number [1..3]).  Look it up in the GCC
: > docs.  Note that you will have to rebuild the libraries you use (including
: > the libraries which come with DJGPP) with that same switch to be
: > consistent with that parameter-passing mechanism. 

: How about just declaring your paramters as register variables?

: void func( register int a, register int b)

: It doesn't necessarily guarantee they will be put in registers, but it 
: at least suggests to the compiler that it would be a good idea.

Well, that's not really the same (I think). When using the register keywork,
the compiler will try to put variables into registers at entry of the function,
but the values are still passed on the stack.


bye, Alexander

--
Alexander Lehmann,                                  |  "On the Internet,
alex AT hal DOT rhein-main DOT de  (plain, MIME, NeXT)         |   nobody knows
alexlehm AT rbg DOT informatik DOT th-darmstadt DOT de (plain)     |   you're a dog."
<URL:http://www.student.informatik.th-darmstadt.de/~alexlehm/>

- Raw text -


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