Atmel ARM-Based Evaluation Kit for SAM4S16C, 32-Bit ARM® Cortex® Microcontroller ATSAM4S-WPIR-RD ATSAM4S-WPIR-RD Data Sheet

Product codes
ATSAM4S-WPIR-RD
Page of 1231
191
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
12.6.11.6MRS
Move the contents of a special register to a general-purpose register.
Syntax
MRS{condRdspec_reg
where:
condis an optional condition code, see 
.
Rdis the destination register.
spec_regcan be any of: APSR, IPSR, EPSR, IEPSR, IAPSR, EAPSR, PSR, MSP, PSP,
PRIMASK, BASEPRI, BASEPRI_MAX, FAULTMASK, or CONTROL.
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. 
Note:
BASEPRI_MAX is an alias of BASEPRI when used with the MRS instruction. 
See 
Restrictions
Rd
 must not be SP and must not be PC.
Condition Flags
This instruction does not change the flags.
Examples
MRS
R0, PRIMASK ; Read PRIMASK value and write it to R0 
12.6.11.7MSR
Move the contents of a general-purpose register into the specified special register.
Syntax
MSR{condspec_regRn
where:
condis an optional condition code, see 
.
Rnis the source register.
spec_regcan be any of: APSR, IPSR, EPSR, IEPSR, IAPSR, EAPSR, PSR, MSP, PSP,
PRIMASK, BASEPRI, BASEPRI_MAX, FAULTMASK, or CONTROL.