msr

Move to System Register

MSR <system_reg>, <Xt>

Moves general-purpose register to system register.

Details

Moves the value from a 64-bit general-purpose register to a system register, enabling modification of processor state, exception handling, and memory management controls. The instruction is AArch64-only and typically requires sufficient privilege level to access the target system register; attempting to write a register without privilege raises an exception. Condition flags are not affected by this instruction.

Pseudocode Operation

SystemRegister[system_reg] ← Xt

Example

MSR system_reg, x3

Encoding

Binary Layout
1101010100
0
1
o0
op1
CRn
CRm
op2
Rt
 
Format System
Opcode 0xD5100000
Extension System

Operands

  • system_reg
    Sys Reg
  • Xt
    Transfer 64-bit integer register (load/store)

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0xD500401F MSR <pstatefield>, #<imm> A64 1101010100000 | op1 | 0100 | CRm | op2 | 11111
0xD5100000 MSR (<systemreg>|S<op0>_<op1>_<Cn>_<Cm>_<op2>), <Xt> A64 1101010100 | 0 | 1 | o0 | op1 | CRn | CRm | op2 | Rt

Description

Move general-purpose register to System Register allows the PE to write an AArch64 System register from a general-purpose register.

Operation

AArch64.SysRegWrite(sys_op0, sys_op1, sys_crn, sys_crm, sys_op2, t);