Chapter 8: Instruction Set Reference
Instruction Set Reference
wrprs
Operation:
Assembler Syntax:
Example:
Description:
Usage:
Exceptions:
Instruction Type:
Instruction Fields:
31
30
29
28
27
26
25
A
February 2014 Altera Corporation
prs.rC ← rA
wrprs rC, rA
wrprs r6, r7
Copies the value of rA in the current register set to rC in the previous register set. This
instruction can set r0 to 0 in a shadow register set.
The previous register set is specified by status.PRS. By default, status.PRS indicates
the register set in use before an exception, such as an external interrupt, caused a
register set change.
To write to an arbitrary register set, software can insert the desired register set number in
status.PRS prior to executing wrprs.
System software must use wrprs to initialize r0 to 0 in each shadow register set before using
that register set.
If shadow register sets are not implemented on the Nios II core, wrprs is an illegal instruction.
Supervisor-only instruction
Illegal instruction
R
A = Register index of operand rA
C = Register index of operand rC
24
23
22
21
20
19
18
17
0
C
write to previous register set
16
15
14
13
12
11
10
9
0x14
8
7
6
5
4
3
2
1
0
0x3a
Nios II Processor Reference Handbook
8–101
0