Mail Archives: djgpp/1996/05/03/18:32:51
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 -