Technical Support
On-Line Manuals
Assembler Reference
Conventions and feedback
Assembler command line options
ARM and Thumb Instructions
Instruction summary
Instruction width specifiers
Memory access instructions
General data processing instructions
Flexible second operand (Operand2)
Operand2 as a constant
Operand2 as a register with optional shift
Shift operations
Multiply instructions
Saturating instructions
Parallel instructions
Parallel add and subtract
Packing and unpacking instructions
Branch and control instructions
Coprocessor instructions
Miscellaneous instructions
ThumbEE instructions
Pseudo-instructions
Condition codes
ADD, SUB, RSB, ADC, SBC, and RSC
ADR (PC-relative)
ADR (register-relative)
ADRL pseudo-instruction
AND, ORR, EOR, BIC, and ORN
ASR, LSL, LSR, ROR, and RRX
B, BL, BX, BLX, and BXJ
BFC and BFI
BKPT
CBZ and CBNZ
CDP and CDP2
CHKA
CLREX
CLZ
CMP and CMN
CPS
CPY pseudo-instruction
DBG
DMB, DSB, and ISB
ENTERX and LEAVEX
ERET
HB, HBL, HBLP, and HBP
IT
LDC, LDC2, STC, and STC2
LDM and STM
LDR and STR (immediate offset)
LDR and STR (register offset)
LDR and STR, unprivileged
LDR (PC-relative)
LDR (register-relative)
LDR pseudo-instruction
LDREX and STREX
MAR and MRA
MCR, MCR2, MCRR, and MCRR2
MIA, MIAPH, and MIAxy
MOV and MVN
MOV32 pseudo--instruction
MOVT
MRC, MRC2, MRRC and MRRC2
MRS (system coprocessor register to ARM register)
MRS (PSR to general-purpose register)
MSR (ARM register to system coprocessor register)
MSR (general-purpose register to PSR)
MUL, MLA, and MLS
NEG pseudo-instruction
PKHBT and PKHTB
PLD, PLDW, and PLI
PUSH and POP
QADD, QSUB, QDADD, and QDSUB
REV, REV16, REVSH, and RBIT
RFE
SBFX and UBFX
SDIV and UDIV
SEL
SETEND
SEV, WFE, WFI, and YIELD
SMC
NOP
SMLAD and SMLSD
SMLALxy
SMLALD and SMLSLD
SMMUL, SMMLA, and SMMLS
SMUAD{X} and SMUSD{X}
SMULxy and SMLAxy
SMULWy and SMLAWy
SRS
SSAT and USAT
SSAT16 and USAT16
SUBS pc, lr
SVC
SWP and SWPB
SXT, SXTA, UXT, and UXTA
SYS
TBB and TBH
TST and TEQ
UMULL, UMLAL, SMULL, and SMLAL
UMAAL
UND pseudo-instruction
USAD8 and USADA8
VFP Programming
Directives Reference
|
Assembler Reference
MSR (general-purpose register to PSR)
MSR (general-purpose register to PSR)Load an immediate value, or the contents of a general-purpose
register, into specified fields of a Program Status Register (PSR). Syntax
MSR{cond} APSR_flags, Rm
where: condis an optional condition code. flagsspecifies the APSR flags to be moved. flags can
be one or more of: nzcvqALU flags field mask, PSR[31:27] (User mode) gSIMD
GE flags field mask, PSR[19:16] (User mode).
Rmis the source register. Rm must
not be PC.
Syntax (except ARMv7-M and ARMv6-M)
You can also use the following syntax on architectures other
than ARMv7-M and ARMv6-M.
MSR{cond} APSR_flags, #constant
MSR{cond} psr_fields, #constant
MSR{cond} psr_fields, Rm
where: condis an optional condition code. flagsspecifies the APSR flags to be moved. flags can
be one or more of: nzcvqALU flags field mask, PSR[31:27] (User mode) gSIMD
GE flags field mask, PSR[19:16] (User mode).
constantis an expression evaluating to a numeric value.
The value must correspond to an 8-bit pattern rotated by an even
number of bits within a 32-bit word. Not available in Thumb. Rmis the source register. Rm must
not be PC. psris one of: CPSRfor
use in Debug state, also deprecated synonym for APSR SPSRon
any processor, in privileged software execution only.
fieldsspecifies the SPSR or CPSR fields to be moved. fields can
be one or more of: ccontrol field mask byte, PSR[7:0] (privileged software
execution) xextension
field mask byte, PSR[15:8] (privileged software execution) sstatus
field mask byte, PSR[23:16] (privileged software execution) fflags
field mask byte, PSR[31:24] (privileged software execution).
Syntax (ARMv7-M and ARMv6-M only)
You can also use the following syntax on ARMv7-M and ARMv6-M.
MSR{cond} psr, Rm
where: condis an optional condition code. Rmis the source register. Rm must
not be PC. psrcan be any of: APSR, IPSR, EPSR, IEPSR, IAPSR, EAPSR, XPSR, MSP, PSP, PRIMASK, BASEPRI, BASEPRI_MAX, FAULTMASK,
or CONTROL.
Usage
In User mode: Use APSR to access
condition flags, Q, or GE bits. Writes to unallocated, privileged or execution state
bits in the CPSR are ignored. This ensures that User mode programs
cannot change to privileged software execution.
If you access the SPSR when in User or System mode, the result
is unpredictable. Register restrictions
If Rm is PC
in ARM instructions, the result is unpredictable.
You can use SP for Rm in
ARM instructions but this is deprecated in ARMv6T2 and above. If Rm is PC
or SP in Thumb instructions, the result is unpredictable. Condition flags
This instruction updates the flags explicitly if the APSR_nzcvq or CPSR_f field
is specified. Architectures
This ARM instruction is available in all versions of the ARM
architecture. This 32-bit Thumb instruction is available in ARMv6T2 and
above. There is no 16-bit Thumb version of this instruction. See also
|