This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Passing an address to a #define in C


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


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