Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

using assembly macro in inline assembly in C

Hi all,

I want to use inline assembly in my code.

I understand that the syntax should be:

asm("<instruct1>;

<instruct2>;

<instruct3>;

....

;");

My problem is that many NIOS II instructions are defines as pseudo-instructions (for instance movi, movia...) and also use assembler macros (for instance %lo, %hi....) and I don't know how to use them with the asm("") function. In other words:

asm("movia r2,1;

movia r3,2;");

won't work because the GCC compiler will not recognize the pseudo-instruction movia defined in the file: nios_macros.s.

If I try to include the file "nios_macros" writing: .include "nios_macros.s" in the c file, it does not work.

What should I do?

Thank you in advance,

Mike
No RepliesBe the first to reply