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] | |
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");
void mycode(void) {
LOAD Label1: INSTRUCTION2 GOTO(Label1) }
Hope that helps, Andi
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |