Passing an address to a #define in C

Ian Lance Taylor iant@google.com
Wed Jun 22 15:09:00 GMT 2011


GusSabina <gussabina@yahoo.com> writes:

> I need to put an specific machine code in any part of the memory. This code
> is for some hardware module that can understand it. Of course, gcc will not
> understand it, so I need to use .word 0xfc to create that code.
> Now, I would like to create a pseudo assembler for my module, in following
> way:
>
> #define       LOAD         asm(".word 0xFC \n\t");
> #define       INSTRUCTION2   asm(.word  0x4b \n\t");
> #define       GOTO(label)         asm(".word " #label " \n\t");

That last has to be "asm goto", q.v.

Ian



More information about the Gcc-help mailing list