3.7.6. MRS

Move the contents of a special register to a general-purpose register.

Syntax

MRS Rd, spec_reg

where:

Rd

is the general-purpose destination register.

spec_reg

is one of the special-purpose registers: APSR, IPSR, EPSR, IEPSR, IAPSR, EAPSR, PSR, MSP, PSP, PRIMASK, or CONTROL.

Operation

MRS stores the contents of a special-purpose register to a general-purpose register. The MRS instruction can be combined with the MSR instruction to produce read-modify-write sequences that are suitable for modifying a specific flag in the PSR.

See MSR.

Restrictions

In this instruction, Rd must not be SP or PC.

Condition flags

This instruction does not change the flags.

Examples

    MRS  R0, PRIMASK ; Read PRIMASK value and write it to R0 

Copyright © 2009 ARM Limited. All rights reserved.ARM DUI 0497A
Non-Confidential