Mail Archives: djgpp/1996/08/14/09:02:32
Bruce Foley wrote:
>
> #define MY_MACRO(MY_ARGUMENT)
> movl MY_ARGUMENT, %eax
> ....
>
Exact. You can define macros like any other macros in C or C++. But you must
tell gcc, that your assembler file should be run at first through the
preprocessor cpp. This can be done very easy. Instead of calling
gcc -c foo.s
compile it with
gcc -c foo.S
NOTE the upper case 'S'. Or compile it with (if you don't like the uppercase S):
gcc -c -x assembler-with-cpp foo.s
> Also, (dumb question time) what is it that actually TERMINATES a macro
> declaration? obviously, for T/MASM, it is the "endm" statement,
> but what about for the #define above?
The ending of the line, if it not ends with a backslash.
Robert
--
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post: Am Berg 3, D-09573 Dittmannsdorf *
* e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE *
* WWW: http://www.tu-chemnitz.de/~rho *
*****************************************************************
- Raw text -