Forum Discussion
Altera_Forum
Honored Contributor
14 years agoMIPS vs Nios II instruction
I am trying to make a MIPS instruction readable by Nios ii (using macros). The instruction moves the content of hi (or low) register to a specified register say for example $reg_A. For th...
Altera_Forum
Honored Contributor
14 years agoI suspect the easiest way to do this is to have a additional register set, and use the 'previous' register set for additional workspace. You could designate the alternate r2 and r3 as %lo and %hi.
Convert the multiply to write it's result into r1 (asm temp - available as a scratch register), then use wrprs to save it in the alternate set. Divide is a bit more tricky since the mips instruction generates the quotient and remainder. But you can still use r1 to generate both results. Reads of %LO and %HI are then rdprs.