Move immediate value to Special register moves selected bits of an immediate value to the corresponding bits in the APSR, CPSR, or SPSR_<current_mode>.
Because of the Do-Not-Modify nature of its reserved bits, the immediate form of MSR is normally only useful at the Application level for writing to APSR_nzcvq (CPSR_f).
If an MSR (immediate) moves selected bits of an immediate value to the CPSR, the PE checks whether the value being written to PSTATE.M is legal. See Illegal changes to PSTATE.M.
An MSR (immediate) executed in User mode:
An MSR (immediate) executed in System mode is constrained unpredictable if it attempts to update the SPSR.
The CPSR.E bit is writable from any mode using an MSR instruction. ARM deprecates using this to change its value.
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
!= 1111 | 0 | 0 | 1 | 1 | 0 | R | 1 | 0 | mask | (1) | (1) | (1) | (1) | imm12 | |||||||||||||||||
cond |
MSR{<c>}{<q>} <spec_reg>, #<imm>
if mask == '0000' && R == '0' then SEE "Related encodings"; imm32 = A32ExpandImm(imm12); write_spsr = (R == '1'); if mask == '0000' then UNPREDICTABLE;
If mask == '0000' && R == '1', then one of the following behaviors must occur:
For more information about the constrained unpredictable behavior of this instruction, see Architectural Constraints on UNPREDICTABLE behaviors.
Related encodings: Move Special Register and Hints (immediate).
<c> |
<q> |
<imm> |
Is an immediate value. See Modified immediate constants in A32 instructions for the range of values. |
if ConditionPassed() then EncodingSpecificOperations(); if write_spsr then if PSTATE.M IN {M32_User,M32_System} then UNPREDICTABLE; else SPSRWriteByInstr(imm32, mask); else // Attempts to change to an illegal mode will invoke the Illegal Execution state mechanism CPSRWriteByInstr(imm32, mask);
If PSTATE.M IN {M32_User,M32_System} && write_spsr, then one of the following behaviors must occur:
Internal version only: isa v00_81, pseudocode v34.2.2 ; Build timestamp: 2018-03-28T20:43
Copyright © 2010-2018 ARM Limited or its affiliates. All rights reserved. This document is Non-Confidential.