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.
12367 Discussions

How to read NIOS-II General Purpose Register's

Altera_Forum
Honored Contributor I
1,077 Views

How to read NIOS-II General purpose Register specifically r29 (Exception return Address) & r30 (Breakpoint return Address) 

 

NIOS-II Processor Reference Handbook Page 3-11
0 Kudos
2 Replies
Altera_Forum
Honored Contributor I
82 Views

If you are working in C, you may need to create a function in assembly language. 

 

See nios2.h and the macros for NIOS2_READ_ET(), NIOS2_WRITE_ET() which operate on register R24 (Exception temporary). I suppose you just need to clone those, but substitute the appropriate register identifier in the assembly language.
Altera_Forum
Honored Contributor I
82 Views

GCC generated code will often save r29 on the stack, and then use r29 as a temporary register. 

Similary the assembler breakpoint stub will save r30 somewhere. 

So the values in the registers are very boring in any C code.
Reply