
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
689 of 808
NXP Semiconductors
UM10360
Chapter 34: Appendix: Cortex-M3 User Guide
2.10.6 MRS
Move the contents of a special register to a general-purpose register.
2.10.6.1
Syntax
MRS
{
cond
}
Rd
,
spec_reg
where:
cond
is an optional condition code, see
Section 34–2.3.7 “Conditional execution”
.
Rd
is the destination register.
spec_reg
can be any of:
APSR
,
IPSR
,
EPSR
,
IEPSR
,
IAPSR
,
EAPSR
,
PSR
,
MSP
,
PSP
,
PRIMASK
,
BASEPRI
,
BASEPRI_MAX
,
FAULTMASK
, or
CONTROL
.
2.10.6.2
Operation
Use
MRS
in combination with
MSR
as part of a read-modify-write sequence for updating a
PSR, for example to clear the Q flag.
In process swap code, the programmers model state of the process being swapped out
must be saved, including relevant PSR contents. Similarly, the state of the process being
swapped in must also be restored. These operations use
MRS
in the state-saving
instruction sequence and
MSR
in the state-restoring instruction sequence.
Remark:
BASEPRI_MAX
is an alias of
BASEPRI
when used with the
MRS
instruction.
See
.
2.10.6.3
Restrictions
Rd
must not be SP and must not be PC.
2.10.6.4
Condition flags
This instruction does not change the flags.
2.10.6.5
Examples
MRS
R0, PRIMASK ; Read PRIMASK value and write it to R0