You copied the Doc URL to your clipboard.

3.7.6. MRS

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

Syntax

MRSRd, 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.

If the current mode of execution is not privileged, then the values of all registers other than the APSR read as zero.

Condition flags

This instruction does not change the flags.

Examples

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

Was this page helpful? Yes No