A macro with inline assembly

Pietro Canevarolo picaneva@tin.it
Fri Oct 27 02:23:00 GMT 2000


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



More information about the crossgcc mailing list