public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* inline assembler
@ 2003-11-05 18:01 y2bismil
  2003-11-05 18:04 ` Falk Hueffner
  2003-11-05 19:07 ` Kimmo Fredriksson
  0 siblings, 2 replies; 9+ messages in thread
From: y2bismil @ 2003-11-05 18:01 UTC (permalink / raw)
  To: GCC- help



Hi all,

I was wondering about inline assember.  I've been reading up quite a bit on it,
and have noticed a common pattern to 'emulate' functions.
***************************************
example from: 
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html
***************************************
#define times3(arg1, arg2) \
__asm__ ( \
  "leal (%0,%0,2),%0" \
  : "=r" (arg2) \
  : "0" (arg1) );
***************************************

Is there a way in inline assembler to do 'real' functions?  As an example
suppose I have the following:  
#define times3(arg1)__asm__ (...);  /*this results in arg1*3*/

Would there be a way for me to say 
int x = times3(arg1);

My guess is no, but I thought I'd check anyways.

Thanks,

Yamin



----------------------------------------
This mail sent through www.mywaterloo.ca

^ permalink raw reply	[flat|nested] 9+ messages in thread
* inline assembler
@ 2000-05-18  1:17 Oldrich Kepka
  2000-05-18  1:30 ` Alexandre Oliva
  0 siblings, 1 reply; 9+ messages in thread
From: Oldrich Kepka @ 2000-05-18  1:17 UTC (permalink / raw)
  To: gcc-help

Hi.

Do anybody know about some good document about inline assembler in gcc.

Thanks


Oldřich Kepka
skola@sanitas.cz
http://www.sanitas.cz/~kepka

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-11-05 19:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-05 18:01 inline assembler y2bismil
2003-11-05 18:04 ` Falk Hueffner
2003-11-05 18:13   ` y2bismil
2003-11-05 18:25     ` Falk Hueffner
2003-11-05 19:07 ` Kimmo Fredriksson
2003-11-05 19:23   ` y2bismil
  -- strict thread matches above, loose matches on Subject: below --
2000-05-18  1:17 Oldrich Kepka
2000-05-18  1:30 ` Alexandre Oliva
2000-05-19  7:57   ` Gary Funck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).