www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/02/13:00:08

Message-Id: <199605021651.JAA06116@bluesky.com>
Comments: Authenticated sender is <kbaca AT bluesky DOT skygames DOT com>
From: "Kevin Baca" <kbaca AT skygames DOT com>
Organization: BlueSky Software
To: djgpp AT delorie DOT com
Date: Thu, 2 May 1996 09:53:45 +0000
Subject: Re: register calling convention

> 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.

-Kevin

- Raw text -


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