public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* GNU AS inline question
@ 2003-05-07 18:54 Rich DAddio
  2003-05-07 19:11 ` Ian Lance Taylor
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rich DAddio @ 2003-05-07 18:54 UTC (permalink / raw)
  To: binutils

I am doing an os port along with a migration to gcc on a basic RISC. And I
am not quite sure if this is the right list for this question so upfront
apologies it this is not appropriate.

Inside one of the low-level init routines is a function and a piece of
inline assembly for a proprietary compiler assembler:

int storeIt;
void theInitCFunction()
{
  //inline assembly
  _AS("st %mp, [storeIt]");
}

Which stashes the value of mp.

Is there an easy way to do the same thing inline with gcc/as?? Do I have to
use extensions?


Thanks,

Rich D

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

* Re: GNU AS inline question
  2003-05-07 18:54 GNU AS inline question Rich DAddio
@ 2003-05-07 19:11 ` Ian Lance Taylor
  2003-05-07 19:11 ` Daniel Jacobowitz
  2003-05-07 19:18 ` Eric Christopher
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2003-05-07 19:11 UTC (permalink / raw)
  To: Rich DAddio; +Cc: binutils

"Rich DAddio" <richdaddio@sandvideo.com> writes:

> I am doing an os port along with a migration to gcc on a basic RISC. And I
> am not quite sure if this is the right list for this question so upfront
> apologies it this is not appropriate.
> 
> Inside one of the low-level init routines is a function and a piece of
> inline assembly for a proprietary compiler assembler:
> 
> int storeIt;
> void theInitCFunction()
> {
>   //inline assembly
>   _AS("st %mp, [storeIt]");
> }
> 
> Which stashes the value of mp.
> 
> Is there an easy way to do the same thing inline with gcc/as?? Do I have to
> use extensions?

http://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/Extended-Asm.html#Extended%20Asm

Ian

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

* Re: GNU AS inline question
  2003-05-07 18:54 GNU AS inline question Rich DAddio
  2003-05-07 19:11 ` Ian Lance Taylor
@ 2003-05-07 19:11 ` Daniel Jacobowitz
  2003-05-07 19:18 ` Eric Christopher
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-05-07 19:11 UTC (permalink / raw)
  To: Rich DAddio; +Cc: binutils

You probably want to look at the GCC manual, which has a chapter on
inline assembly.  You can do the same thing, but the syntax will be a
little different.  At a guess, probably something like:
  asm ("st %%mp, %0" : "=m" (storeIt));

On Wed, May 07, 2003 at 02:54:34PM -0400, Rich DAddio wrote:
> I am doing an os port along with a migration to gcc on a basic RISC. And I
> am not quite sure if this is the right list for this question so upfront
> apologies it this is not appropriate.
> 
> Inside one of the low-level init routines is a function and a piece of
> inline assembly for a proprietary compiler assembler:
> 
> int storeIt;
> void theInitCFunction()
> {
>   //inline assembly
>   _AS("st %mp, [storeIt]");
> }
> 
> Which stashes the value of mp.
> 
> Is there an easy way to do the same thing inline with gcc/as?? Do I have to
> use extensions?
> 
> 
> Thanks,
> 
> Rich D
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: GNU AS inline question
  2003-05-07 18:54 GNU AS inline question Rich DAddio
  2003-05-07 19:11 ` Ian Lance Taylor
  2003-05-07 19:11 ` Daniel Jacobowitz
@ 2003-05-07 19:18 ` Eric Christopher
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Christopher @ 2003-05-07 19:18 UTC (permalink / raw)
  To: Rich DAddio; +Cc: binutils

On Wed, 2003-05-07 at 11:54, Rich DAddio wrote:
> I am doing an os port along with a migration to gcc on a basic RISC. And I
> am not quite sure if this is the right list for this question so upfront
> apologies it this is not appropriate.
> 

Wrong list, but close enough this time :)


> Is there an easy way to do the same thing inline with gcc/as?? Do I have to
> use extensions?

http://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/Extended-Asm.html#Extended%20Asm

-eric
-- 
Eric Christopher <echristo@redhat.com>

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-07 18:54 GNU AS inline question Rich DAddio
2003-05-07 19:11 ` Ian Lance Taylor
2003-05-07 19:11 ` Daniel Jacobowitz
2003-05-07 19:18 ` Eric Christopher

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