Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12612 Discussions

loading/storing a register

Altera_Forum
Honored Contributor II
1,052 Views

Hi! 

 

again an assembler-related question: 

 

look at this code 

 

movhi r3, %hiadj(mylabel) 

addi r3,r3, %lo(mylabel) 

stw r2, 0(r3) 

 

and now at this: 

 

movhi r3, %hiadj(mylabel) 

stw r2, %lo(mylabel)(r3) 

 

excluding the fact that r3 at the end is loaded with two different values,  

does the second piece of code store r2 in the address of mylabel? 

 

Best Regards, 

 

Paolo
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
336 Views

Yes, I believe it does. 

 

Kerry
0 Kudos
Altera_Forum
Honored Contributor II
336 Views

Many Thanks! 

 

Paolo
0 Kudos
Reply