MSR

https://developer.arm.com/documentation/dui0068/b/ARM-Instruction-Reference/Miscellaneous-ARM-instructions/MSR

Loads specified fields of the CPSR1 or SPSR2 with an#imm or

MRS

https://developer.arm.com/documentation/dui0068/b/ARM-Instruction-Reference/Miscellaneous-ARM-instructions/MRS

  • Move the contents of the CPSR or SPSR to general purpose register
  • Move System Register to general-purpose register
MRS{cond} Rd, psr

Footnotes

  1. Current Program Status Register

    CPSR

    CPSR: Current Program Status Register

    https://developer.arm.com/documentation/ddi0601/2023-12/AArch32-Registers/CPSR—Current-Program-Status-Register?lang=en https://developer.arm.com/documentation/dui0473/m/overview-of-the-arm-architecture/current-program-status-register

    • APSR flags
    • Processor Mode
    • Interrupt Disable Flags
    • The Instruction set state (ARM, Thumb, ThumbEE or Jazelle)
    • The endianness state (ARMv4tT and later)
    • The execution state bits for the IT block (ARMv6T2 and later)

    Fields

    313029282726~242322212019~1615~109876543~0
    NZCVQRES0SSBSPANDITRES0GERES0EAIFRES0RES1M

    E bit[9]

    • Endianness State bit | E | Meaning | | --- | ----------------------- | | 0b0 | Little-Endian Operation | | 0b1 | Big-Endian Operation |

    A bit[8]

    SError(SystemError) Exception mask bit

    AMeaning
    0Exception not masked
    1Exception masked

    I bit[7]

    IRQ mask bit

    IMeaning
    0Exception not masked
    1Exception masked

    F bit[6]

    FIQ mask bit

    FMeaning
    0Exception not masked
    1Exception masked

    M bit[3:0]

    • Current PE Mode
    MMeaning
    0b0000User
    0b0001FIQ
    0b0010IRQ
    0b0011Supervisor
    0b0110Monitor
    0b01111Abort
    0b1010Hyp.
    0b1011Undefined
    0b1111System
    Link to original

  2. Saved Program Status Register

    SPSR

    SPSR: Saved Program Status Register

    https://developer.arm.com/documentation/ddi0601/2023-12/AArch32-Registers/SPSR—Saved-Program-Status-Register

    • Saves the current CPSR when an exception is taken..
    • so that CPSR can be restored after exception handling
    Link to original