This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A macro with inline assembly


Thank you for your answer.
And I will use linker script to force the segment.

----- Original Message -----
From: "Pietro Canevarolo" <picaneva@tin.it>
To: "mike" <mike@penbex.com.tw>
Cc: <crossgcc@sources.redhat.com>
Sent: Friday, October 27, 2000 7:23 PM
Subject: Re: A macro with inline assembly


> Why don't you write all in C?
>
> example:
>
> extern void pippo( void );
> extern void pluto( void );
>
> const voif (* entryPoints[] )( void ) =
> {
> pippo,
> pluto
> };
>
> You can also force the segment where the array must be placed (I am not
> absolutely sure of the syntax, but I cannot try to compile it now...:-)
>
> Ciao, Piero
>
> mike ha scritto:
> >
> > I need put the offset of functions in the begin of source file.
> > Because it will get easy when I try to load that program
> > dynamic and execute it. (jump to it)
> > So, my source is look like below. (My target is m68k-coff)
> > ----------
> > __asm__ ("dc.l add");
> > __asm__ ("dc.l sub");
> >
> > void add (long i, long j, long* k)
> > { *k = i + j; }
> >
> > void sub (long i, long j, long* k)
> > { *k = i - j; }
> > ---------
> > When I try to beautify my inline assembly
> > __asm__ ("dc.l add"); --> DC (add);
> > using a macro, I got problem. My macro is
> > #define DC(func) __asm__ ("dc.l %0" : : "g" (func))
> > But, this macro can only do
> > DC (add); -> dc.l #add
> > How do I modify my macro to take off that '#'.
> >
> > ------
> > Want more information?  See the CrossGCC FAQ,
http://www.objsw.com/CrossGCC/
> > Want to unsubscribe? Send a note to
crossgcc-unsubscribe@sourceware.cygnus.com
>
> ------
> Want more information?  See the CrossGCC FAQ,
http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to
crossgcc-unsubscribe@sourceware.cygnus.com
>


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]