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++
Announcements
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.
12435 Discussions

How to access a NIOS II ALU instruction from an application code?

Altera_Forum
Honored Contributor II
793 Views

Hello, 

 

This question might sound trivial, however since I am a beginner I am forced to ask this as well. 

How to call the NIOS II ALU ADD instruction from an application code in C which runs on NIOS II IDE? 

I searched in the manuals however could not find a good direction. 

 

add rC, rA, rB is the assembly instruction for it. (However I need a C equivalent) 

I see the HAL folder in the NIOS II which has many abstraction functions, so I was wondering are there any  

IO layer function equivalents which I can use for ADD (which goes and access the driver level functions) ? 

Or some macros (which are built during the entire build process). 

 

Please help me out here. 

 

 

Thank You, 

Akhil
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
78 Views

Just use the "+" operator naturally in C. 

 

int add(int a, int b) 

return a+b; 

}
Reply