Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

assembly inline C for NIOS II

Honored Contributor II

Hi all, 


I am new for NIOS II application develoment.  

And I need to embed a few lines of assembly  

in my C code. like: 


# include "system.h" 


void main() 

C code 1; 

_asm_("assembly 1"); 

C code 2; 

_asm_("assembly 2"); 

C code 3; 




My question is if the Nios II SBT will automatically  

save the previous operation results (from registers  

or somewhere else) before execute the assembly.  

As we know it does when the system handle interrupt.  

But how about this sutiation? Thanks in advance if you can help.:) 


0 Kudos
1 Reply
Honored Contributor II

You need to read up how gcc does inline assembly.